/* ========================================
   FAQ PAGE STYLES - COMPREHENSIVE GUIDE
   Steve Jobs + Modern Design System
   ======================================== */

/* CSS Variables - Direct fallbacks (no variable mapping to avoid conflicts) */
:root {
    /* Base variables with fallbacks - will be overridden by theme system */
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--theme-text-primary);
    background-color: var(--theme-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Header - Higher specificity to override theme-aware-header */
.faq-header.theme-aware-header {
    background: var(--theme-bg-primary) !important;
    border-bottom: 1px solid var(--theme-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo-section {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
}

.logo {
    height: 32px;
    width: auto;
    margin-right: 12px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

.header-nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
    padding: 8px 0;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -17px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* Theme toggle button in navigation */
.header-nav .theme-toggle {
    margin-left: 8px;
    width: 36px;
    height: 36px;
    padding: 6px;
}

.header-nav .theme-toggle .theme-icon {
    width: 18px;
    height: 18px;
}

/* Breadcrumb */
.breadcrumb {
    background: var(--background-light);
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumb-nav a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

.breadcrumb-separator {
    margin: 0 8px;
    color: var(--text-light);
}

.breadcrumb-current {
    color: var(--text-color);
    font-weight: 500;
}

/* Main Content */
.faq-main {
    padding: 40px 0 80px;
    background: var(--background-light);
    min-height: calc(100vh - 64px);
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 60px;
}

.page-title {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 16px;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
    align-items: start;
}

/* Sticky Navigation */
.faq-nav {
    position: sticky;
    top: 100px;
    background: var(--background-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.faq-nav::-webkit-scrollbar {
    width: 6px;
}

.faq-nav::-webkit-scrollbar-track {
    background: transparent;
}

.faq-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.nav-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background: var(--background-light);
    color: var(--text-color);
}

.nav-item.active {
    background: rgba(0, 123, 255, 0.08);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    margin-right: 12px;
    font-size: 16px;
    opacity: 0.7;
}

.nav-text {
    flex: 1;
}

/* FAQ Content */
.faq-content {
    background: var(--background-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

/* FAQ Sections */
.faq-section {
    padding: 48px 48px 32px;
    border-bottom: 1px solid var(--border-color);
}

.faq-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 32px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    display: inline-block;
}

/* FAQ Items */
.faq-item {
    margin-bottom: 32px;
    padding: 32px;
    background: var(--background-section);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.faq-item:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.faq-item:last-child {
    margin-bottom: 0;
}

.question {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 16px;
    line-height: 1.3;
}

.answer {
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.7;
}

.answer p {
    margin-bottom: 16px;
}

.answer p:last-child {
    margin-bottom: 0;
}

.answer ul,
.answer ol {
    margin: 16px 0;
    padding-left: 24px;
}

.answer li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.answer strong {
    color: var(--text-color);
    font-weight: 600;
}

.answer a {
    color: var(--text-color);
    text-decoration: underline;
    font-weight: 500;
    transition: var(--transition);
}

.answer a:hover {
    color: var(--text-muted);
    text-decoration: underline;
}

/* Special Content Boxes */
.highlight-box {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.08) 0%, rgba(0, 123, 255, 0.04) 100%);
    border: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
}

.highlight-box::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    background: var(--background-color);
    padding: 0 8px;
    font-size: 16px;
}

/* CTA Sections */
.cta-section {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.08) 0%, rgba(40, 167, 69, 0.04) 100%);
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    text-align: center;
    transition: var(--transition);
}

.cta-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.cta-section h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
}

.cta-section p {
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.cta-button:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    color: white;
    text-decoration: none;
}

/* Tax Tables */
.tax-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin: 24px 0;
}

.tax-table {
    background: var(--background-color);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
}

.tax-table h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 16px;
    text-align: center;
    padding: 12px;
    background: var(--background-light);
    border-radius: 8px;
}

.tax-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tax-table th {
    background: var(--background-light);
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    font-size: 13px;
}

.tax-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.tax-table tbody tr:hover {
    background: rgba(0, 123, 255, 0.04);
}

.table-note {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 12px;
    text-align: center;
}

/* Regime Comparison */
.regime-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 24px 0;
}

.regime-card {
    background: var(--background-color);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 2px solid var(--border-color);
    position: relative;
    transition: var(--transition);
}

.regime-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.new-regime {
    border-color: var(--accent-color);
}

.old-regime {
    border-color: var(--text-muted);
}

.regime-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
}

.new-regime h4 {
    background: rgba(40, 167, 69, 0.1);
    color: var(--accent-color);
}

.old-regime h4 {
    background: rgba(102, 102, 102, 0.1);
    color: var(--text-muted);
}

.regime-pros h5,
.regime-features h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.regime-pros ul,
.regime-features ul {
    font-size: 14px;
    margin-bottom: 20px;
}

/* Break-even Analysis */
.breakeven-analysis {
    background: var(--background-section);
    border-radius: var(--border-radius);
    padding: 24px;
    margin: 24px 0;
    border: 1px solid var(--border-color);
}

.breakeven-analysis h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 16px;
}

/* Switching Rules */
.switching-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 24px 0;
}

.rule-card {
    background: var(--background-color);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
}

.rule-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color);
}

.rule-card ul {
    font-size: 14px;
}

/* Footer */
.faq-footer {
    background: var(--text-color);
    color: var(--background-color);
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 32px;
}

.footer-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--background-color);
}

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

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

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--background-color);
}

.footer-section p {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
@media (max-width: 968px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .faq-nav {
        position: static;
        max-height: none;
        order: 2;
    }
    
    .nav-menu {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header-content {
        height: 56px;
    }
    
    .header-nav {
        gap: 20px;
    }
    
    .nav-link {
        font-size: 13px;
    }
    
    .page-header {
        margin-bottom: 40px;
    }
    
    .page-subtitle {
        font-size: 16px;
    }
    
    .faq-section {
        padding: 32px 24px 24px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .faq-item {
        padding: 24px 20px;
    }
    
    .question {
        font-size: 18px;
    }
    
    .answer {
        font-size: 15px;
    }
    
    .tax-tables,
    .regime-comparison,
    .switching-rules {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .faq-nav {
        padding: 16px;
    }
    
    .nav-menu {
        grid-template-columns: 1fr;
    }
    
    .faq-section {
        padding: 24px 16px 20px;
    }
    
    .faq-item {
        padding: 20px 16px;
    }
    
    .tax-table {
        padding: 16px;
    }
    
    .tax-table table {
        font-size: 12px;
    }
    
    .tax-table th,
    .tax-table td {
        padding: 8px 4px;
    }
}

/* Visual Elements - CTC Breakdown and Flowcharts */

/* CTC Visual Breakdown */
.ctc-visual-breakdown {
    margin: 32px 0;
    padding: 24px;
    background: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.ctc-visual-breakdown h4 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-color);
}

.ctc-diagram {
    max-width: 100%;
}

.ctc-bar {
    display: flex;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    margin-bottom: 20px;
}

.ctc-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    position: relative;
    transition: var(--transition);
}

.ctc-segment:hover {
    transform: scaleY(1.1);
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.ctc-segment.basic { background: linear-gradient(135deg, #007bff, #0056b3); }
.ctc-segment.hra { background: linear-gradient(135deg, #28a745, #1e7e34); }
.ctc-segment.allowances { background: linear-gradient(135deg, #ffc107, #e0a800); }
.ctc-segment.benefits { background: linear-gradient(135deg, #6f42c1, #5a32a3); }

.segment-label {
    font-size: 12px;
    line-height: 1.2;
}

.ctc-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-muted);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 8px;
}

.legend-color.basic { background: linear-gradient(135deg, #007bff, #0056b3); }
.legend-color.hra { background: linear-gradient(135deg, #28a745, #1e7e34); }
.legend-color.allowances { background: linear-gradient(135deg, #ffc107, #e0a800); }
.legend-color.benefits { background: linear-gradient(135deg, #6f42c1, #5a32a3); }

/* Tax Regime Decision Flowchart */
.regime-flowchart {
    margin: 32px 0;
    padding: 24px;
    background: var(--background-section);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.regime-flowchart h4 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-color);
}

.flowchart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.flow-box,
.decision-box,
.result-box {
    padding: 16px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.flow-box {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.decision-box {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #333;
    font-size: 14px;
}

.decision-box strong {
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

.flow-arrow {
    font-size: 24px;
    color: var(--primary-color);
    font-weight: bold;
}

.flow-branches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    width: 100%;
    max-width: 600px;
}

.branch-left,
.branch-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.flow-arrow-left,
.flow-arrow-right {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.result-box {
    font-size: 14px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.old-regime-result {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
    border: 2px solid var(--accent-color);
    color: var(--text-color);
}

.new-regime-result {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 123, 255, 0.05));
    border: 2px solid var(--primary-color);
    color: var(--text-color);
}

.result-box strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

/* Responsive Design for Visual Elements */
@media (max-width: 768px) {
    .ctc-bar {
        height: 100px;
        flex-direction: column;
    }
    
    .ctc-segment {
        height: 25px;
        font-size: 11px;
    }
    
    .ctc-legend {
        grid-template-columns: 1fr;
    }
    
    .flow-branches {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .segment-label {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .ctc-segment {
        height: 20px;
        font-size: 10px;
        padding: 4px;
    }
    
    .segment-label br {
        display: none;
    }
    
    .segment-label {
        font-size: 9px;
    }
}

/* Dark Theme Support - Now handled by shared theme system automatically via CSS variable mapping */