
/* ---------- Tax Info Page Enhancements ---------- */
.tax-container {
    max-width: 1000px;
    margin: 0 auto;
}

.tax-section {
    margin-bottom: 60px;
}

/* --- Tax Interactive Hub (Mobile Nav) --- */
.tax-hub-nav {
    display: none; /* Hidden on desktop */
}

.tax-nav-pills {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 15px 0 10px;
    scrollbar-width: none; /* Hide scrollbar Firefox */
    -ms-overflow-style: none; /* Hide scrollbar IE */
}

.tax-nav-pills::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.tax-nav-pill {
    white-space: nowrap;
    padding: 8px 16px;
    background: var(--white);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--light-gray);
    transition: var(--transition);
}

.tax-nav-pill.active {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
    box-shadow: var(--shadow-sm);
}

.tax-section-wrapper {
    position: relative;
    min-height: 400px;
}

/* --- Mobile Only Regime Toggle --- */
.mobile-regime-toggle {
    display: none; /* Desktop hidden */
    background: rgba(255, 255, 255, 0.4);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin: 0 auto 10px;
    justify-content: center;
    gap: 4px;
    max-width: 280px;
    backdrop-filter: blur(5px);
}

.mobile-regime-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    border: none;
    background: none;
    text-align: center;
}

.mobile-regime-btn.active {
    background: var(--navy);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

/* Consistently Styled Card Headers (flex box for icon + text) */
.tax-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.tax-card-header h3 {
    margin: 0;
    color: var(--navy);
    font-size: 1.15rem;
}

.tax-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.tax-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--navy), var(--red));
}

.tax-highlight {
    display: inline-block;
    padding: 6px 14px;
    background: var(--red-light);
    color: var(--red);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tax-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.tax-feature {
    background: var(--off-white);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: var(--transition);
    height: 100%;
}

.tax-feature:hover {
    border-color: var(--light-gray);
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
}

.tax-feature-icon {
    width: 48px;
    height: 48px;
    background: var(--red-light);
    color: var(--red);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.tax-feature-icon.compact {
    margin-bottom: 0;
}

.tax-feature-icon svg {
    width: 24px;
    height: 24px;
}

/* Optimization Utilities */
.tax-list-styled {
    margin-top: 12px;
    list-style: disc;
    padding-left: 20px;
    color: var(--text-secondary);
}

.tax-list-styled li {
    margin-bottom: 8px;
}

.tax-muted-small {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tax-disclaimer-italic {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.tax-table-wrapper {
    margin: 30px 0;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--light-gray);
    background: var(--white);
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.tax-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.tax-table th {
    background: var(--navy);
    color: var(--white);
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Sticky first column for mobile context */
.tax-table th:first-child,
.tax-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: var(--white);
    border-right: 1px solid var(--light-gray);
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

.tax-table th:first-child {
    background-color: var(--navy);
}

.tax-table tr:nth-child(even) td:first-child {
    background-color: #fbfbfc;
}

.tax-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--light-gray);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.tax-table tr:last-child td {
    border-bottom: none;
}

.tax-table tr:nth-child(even) {
    background: #fbfbfc;
}

.tax-cta {
    background: linear-gradient(135deg, var(--navy) 0%, #001a3d 100%);
    color: var(--white);
    padding: 60px 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-top: 40px;
}

.tax-cta h3 {
    color: var(--white);
    margin-bottom: 16px;
}

.tax-cta p {
    color: rgba(255, 255, 255, 0.8);
    max-width: 700px;
    margin: 0 auto 32px;
}

/* FAQ Accordion Optimization */
.tax-faq {
    margin-top: 80px;
}

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

.faq-item {
    background: var(--white);
    border: 1px solid var(--light-gray);
    margin-bottom: 16px;
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.faq-question {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    color: var(--navy);
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--off-white);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    line-height: 1.7;
}

.faq-answer-inner {
    padding: 0 24px 24px;
}

.faq-item.active {
    border-color: var(--red);
    box-shadow: var(--shadow-md);
}

.faq-icon {
    transition: transform 0.4s var(--ease);
    color: var(--red);
    flex-shrink: 0;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* Badges */
.regime-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.badge-new { background: #e0f2fe; color: #0369a1; }

@media (max-width: 768px) {
    /* Kill the massive section padding on mobile for the tax page */
    .tax-section-main {
        padding-top: 10px !important;
        padding-bottom: 30px !important;
    }

    /* Unified Dashboard Header */
    .tax-hub-nav {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        position: sticky !important;
        top: 60px; /* Header height */
        background: #f8fafc; /* Professional dashboard background */
        z-index: 1000;
        margin: -10px -20px 20px -20px !important;
        padding: 10px 15px 12px 15px !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 4px 10px -5px rgba(0, 0, 0, 0.1);
        gap: 8px; /* Tight vertical gap between pills and toggle */
    }
    
    .tax-nav-pills {
        display: flex !important;
        width: 100%;
        padding: 0 !important;
        margin: 0 !important;
        gap: 8px;
        overflow-x: auto;
    }

    .mobile-regime-toggle {
        display: flex !important;
        margin: 0 !important;
        padding: 4px !important;
        background: rgba(0, 0, 0, 0.04);
        border: 1px solid rgba(0, 0, 0, 0.05);
        max-width: 280px;
        width: 100%;
    }

    .mobile-regime-btn {
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
        line-height: 1.2;
    }
    
    .tax-nav-pill {
        padding: 8px 14px !important;
        font-size: 0.75rem !important;
        line-height: 1;
    }

    /* Content Switching Logic */
    .tax-container {
        overflow: visible !important;
    }

    .tax-section-wrapper .tax-section {
        display: none;
        padding-top: 10px;
        animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    /* Active section visibility */
    .tax-container[data-active-tab="slabs"] #regimes,
    .tax-container[data-active-tab="huf"] #huf-tax,
    .tax-container[data-active-tab="insurance"] #insurance,
    .tax-container[data-active-tab="investments"] #investments,
    .tax-container[data-active-tab="seniors"] #seniors,
    .tax-container[data-active-tab="faq"] .tax-faq {
        display: block !important;
    }

    @keyframes fadeInUp {
        from { opacity: 0; transform: translateY(15px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .tax-card {
        padding: 20px 15px !important;
        border-radius: var(--radius) !important;
        box-shadow: var(--shadow-sm) !important;
        margin-bottom: 20px !important;
    }
    
    .tax-card-header {
        margin-bottom: 12px;
    }
    
    .tax-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tax-table {
        min-width: 100% !important;
        border-radius: 8px;
    }

    .tax-table th:first-child,
    .tax-table td:first-child {
        position: static !important;
        box-shadow: none !important;
        border-right: 1px solid var(--light-gray) !important;
        min-width: 80px;
    }

    .tax-container.regime-new .col-old,
    .tax-container.regime-old .col-new {
        display: none !important;
    }

    .tax-table th, .tax-table td {
        padding: 8px 6px !important;
        font-size: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    .tax-hub-nav {
        top: 55px; /* Adjust if header shrinks on tiny screens */
    }
}
