/* Premium Professional Design 2.0 */
:root {
    --primary-color: #2563eb;
    /* Royal Blue */
    --primary-dark: #1e40af;
    --accent-color: #10b981;
    /* Success Green */
    --text-main: #1f2937;
    --text-lead: #374151;
    --text-light: #6b7280;
    --bg-body: #f3f4f6;
    --white: #ffffff;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

main {
    padding-top: 4rem;
    /* Space for fixed header */
    padding-bottom: 4rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Navigation (Approved) --- */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    height: 70px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.025em;
}

.logo-accent {
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 32px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-lead);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.btn-nav {
    background: var(--primary-color);
    color: white !important;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600 !important;
}

.btn-nav:hover {
    background: var(--primary-dark);
}

/* --- Search Bar --- */
.search-container {
    position: relative;
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 10px 16px;
    padding-left: 40px;
    /* Space for icon */
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #f8fafc;
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
}

.search-input:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    margin-top: 8px;
    padding: 8px 0;
    display: none;
    /* Hidden by default */
    z-index: 2000;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #f1f5f9;
}

.search-results.active {
    display: block;
}

.search-item {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-lead);
    font-size: 0.95rem;
    transition: background 0.1s;
}

.search-item:hover {
    background: #eff6ff;
    color: var(--primary-color);
}

.no-results {
    padding: 12px 16px;
    color: #94a3b8;
    font-size: 0.9rem;
    text-align: center;
}

/* --- Homepage Hero --- */
.hero {
    background: linear-gradient(to right, #1e3a8a, #2563eb);
    color: white;
    padding: 100px 0 140px;
    /* Extra bottom padding for overlap */
    text-align: center;
    position: relative;
    margin-top: -4rem;
    /* Pull into header space if transparent */
    margin-bottom: -60px;
    /* Overlap grid */
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto;
}

/* --- Card Grid --- */
.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 60px 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* Subtle shadow */
    border: 1px solid #f3f4f6;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-color);
}

.card h2 {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--text-main);
    font-weight: 700;
}

.card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 24px;
    flex-grow: 1;
}

.card .btn {
    align-self: flex-start;
    background: #eff6ff;
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.card:hover .btn {
    background: var(--primary-color);
    color: white;
}


/* --- Calculator Page Design --- */
.page-layout {
    display: flex;
    gap: 40px;
    margin-top: 20px;
    align-items: flex-start;
}

/* The Main Calculator Form */
.calculator-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    flex: 2;
}

.calculator-box h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-lead);
    font-size: 0.95rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 14px 16px;
    /* Louder inputs */
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #f9fafb;
    transition: all 0.2s;
    box-sizing: border-box;
}

.input-group input:focus,
.input-group select:focus {
    background-color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    /* Focus ring */
    outline: none;
}

.calc-actions {
    display: flex;
    gap: 16px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.calc-actions button {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s;
}

#calculate-btn {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

#calculate-btn:hover {
    background: var(--primary-dark);
}

#reset-btn {
    background: transparent;
    color: var(--text-light);
    border: 1px solid #d1d5db;
}

#reset-btn:hover {
    background: #f3f4f6;
    color: var(--text-main);
}

/* Result Box */
.result-area {
    margin-top: 40px;
    background: #f0f9ff;
    /* Light Blue BG */
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 32px;
}

.result-area h3 {
    margin-top: 0;
    color: #0369a1;
    font-size: 1.25rem;
}

/* --- Sidebar --- */
.column-right {
    flex: 1;
    position: sticky;
    top: 100px;
}

.sidebar-box {
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    /* For header color */
}

.sidebar-box h3 {
    background: #f8fafc;
    margin: 0;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    font-weight: 700;
}

.sidebar-links {
    padding: 10px 0;
}

.sidebar-links a {
    display: block;
    padding: 12px 20px;
    color: var(--text-lead);
    text-decoration: none;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-links a:hover {
    background: #eff6ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

/* --- Content SEO Area --- */
.seo-content {
    margin-top: 60px;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.seo-content h2 {
    color: var(--text-main);
    font-size: 1.8rem;
    margin-top: 0;
}

.seo-content h3 {
    color: var(--text-lead);
    margin-top: 2rem;
}

.intro-text {
    font-size: 1.2rem;
    color: var(--text-light);
    line-height: 1.8;
}

.faq-section {
    margin-top: 40px;
}

.faq-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f3f4f6;
}

.faq-item h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.faq-item p {
    margin: 0;
    color: var(--text-light);
}

/* --- Footer (Approved) --- */
footer {
    background: #111827;
    color: #9ca3af;
    padding-top: 80px;
    margin-top: 100px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-section h3 {
    color: white;
    font-size: 1.5rem;
    margin-top: 0;
}

.footer-section h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #1f2937;
    padding: 32px 0;
    text-align: center;
}

@media (max-width: 768px) {
    .page-layout {
        flex-direction: column;
    }

    .hero {
        padding: 80px 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}
/* ============================
   BREADCRUMB NAVIGATION
   ============================ */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    color: #6b7280;
}
.breadcrumb a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: #9ca3af; user-select: none; }
.breadcrumb-current { color: #6b7280; }

/* ============================
   CALCULATOR DIRECTORY PAGE
   ============================ */
.calc-dir-section { margin-bottom: 48px; }
.calc-dir-heading {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}
.calc-dir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.calc-dir-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.calc-dir-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37,99,235,0.12);
    transform: translateY(-2px);
}
.calc-dir-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2563eb;
}
.calc-dir-desc {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.4;
}


/* ============================
   SEO OVERHAUL — NEW UI ELEMENTS
   ============================ */

/* Last Updated Badge */
.updated {
    font-size: 0.8rem;
    color: #6b7280;
    margin: -8px 0 18px;
    letter-spacing: 0.01em;
}

/* How to Use Steps */
.how-to-use {
    background: #f0f4ff;
    border-left: 4px solid #2563eb;
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin-top: 20px;
}
.how-to-use h3 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e3a8a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.how-to-steps {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.how-to-steps li {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.6;
}

/* Use Cases Section */
.use-cases-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px 24px;
    margin-top: 32px;
}
.use-cases-section h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: #0f172a;
}
.use-cases-list {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.use-cases-list li {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.6;
}

/* Popular Calculators Cards (Homepage) */
.popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 48px;
}
.popular-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.popular-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(37,99,235,0.35);
    color: #fff;
}
.popular-icon {
    font-size: 1.8rem;
    line-height: 1;
}
.popular-card strong {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
}
.popular-card span:not(.popular-icon) {
    font-size: 0.75rem;
    opacity: 0.85;
    line-height: 1.3;
}

/* Category Count Badge */
.category-count {
    font-size: 0.85rem;
    font-weight: 400;
    color: #6b7280;
    margin-left: 6px;
}

/* Formula Box Enhancement */
.formula-box h3 {
    color: #1e3a8a;
    font-family: 'Courier New', monospace;
}
