/* ========================================
   FAQ SECTION STYLES
   Steve Jobs + Sundar Pichai Inspired Design
   ======================================== */

/* Layout Structure - Vertical and Horizontal Panels */
/* CRITICAL: Override external CSS height constraints to allow FAQ below */
body {
    height: auto !important;
    min-height: 100vh !important;
}

.app-container {
    min-height: auto !important;
}

.vertical-panels-container {
    /* Container for all vertical panels (sidebar, main, comparison, insights) */
    transition: transform 0.4s ease, box-shadow 0.3s ease;
}

.horizontal-faq-container {
    margin-top: 40px; /* Buffer space between vertical and horizontal sections */
    border-top: 2px solid var(--color-border);
    opacity: 1;
    transition: all 0.4s ease;
    background: var(--color-bg-secondary);
    min-height: 200px; /* Ensure visibility */
    visibility: visible !important; /* CRITICAL: Override external CSS hiding FAQ */
}

.faq-section {
    background: var(--color-bg-secondary);
    transition: all 0.3s ease;
    visibility: visible !important; /* CRITICAL: Override external CSS hiding FAQ */
    color: var(--color-text-primary);
}

.faq-item {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.faq-item[open] {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.faq-question:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* Elegant dropdown arrow animation */
.faq-item[open] .faq-icon {
    transform: rotate(180deg);
}

/* Smooth content expansion */
.faq-item[open] .faq-answer {
    animation: fadeInDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    .faq-section {
        padding: 40px 16px;
    }
    
    .faq-title {
        font-size: 24px !important;
        margin-bottom: 32px !important;
    }
    
    .faq-question {
        padding: 20px !important;
        font-size: 15px !important;
    }
    
    .faq-answer {
        padding: 0 20px 20px !important;
        font-size: 14px !important;
    }
}

/* FAQ Back Button Styling */
.faq-back-button:hover {
    background: #f0f0f0;
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-1px);
}

.faq-back-button:active {
    transform: translateY(0);
}

/* Theme-aware styles using correct CSS variables */
.faq-title {
    color: var(--color-text-primary) !important;
}

.faq-back-button {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

.faq-back-button:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-1px);
}

.faq-quick-nav {
    background: var(--color-bg-primary) !important;
    border: 1px solid var(--color-accent) !important;
    color: var(--color-text-primary) !important;
}

.faq-quick-nav p {
    color: var(--color-text-primary) !important;
}

.faq-item {
    background: var(--color-bg-primary) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 12px !important;
    margin-bottom: 16px !important;
    overflow: hidden !important;
    color: var(--color-text-primary) !important;
}

.faq-question {
    padding: 24px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    user-select: none !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif !important;
    color: var(--color-text-primary) !important;
    background: transparent !important;
}

.faq-question:hover {
    background: var(--color-bg-tertiary) !important;
}

.faq-answer {
    padding: 0 24px 24px !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif !important;
    color: var(--color-text-secondary) !important;
}

.faq-answer p {
    color: var(--color-text-secondary) !important;
}

.faq-answer ul {
    margin: 12px 0 !important;
    padding-left: 20px !important;
    color: var(--color-text-secondary) !important;
}

.faq-answer li {
    color: var(--color-text-secondary) !important;
}

.faq-answer strong {
    color: var(--color-text-primary) !important;
}

.faq-icon {
    font-size: 12px !important;
    transition: transform 0.2s ease !important;
    color: var(--color-text-muted) !important;
}

/* Links in FAQ answers */
.faq-answer a {
    color: var(--color-accent) !important;
    text-decoration: none !important;
}

.faq-answer a:hover {
    text-decoration: underline !important;
}

/* Enhanced hover effects for both themes */
.faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.faq-item[open] {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Light mode specific adjustments */
.light-mode .faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.light-mode .faq-item[open] {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* FAQ Topics Section Styles */
.faq-topics {
    margin-top: 32px;
    padding: 20px;
    background: var(--color-bg-tertiary, #f8f9fa);
    border-radius: 12px;
    border: 1px solid var(--color-border, #dee2e6);
    transition: all 0.3s ease;
}

.faq-topics-title {
    margin-bottom: 16px;
    font-size: 18px;
    color: var(--color-text-primary, #333333);
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
    font-weight: 500;
}

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

.faq-topic-link {
    text-decoration: none;
    color: var(--color-accent, #007bff);
    padding: 8px 12px;
    background: var(--color-bg-primary, white);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
    display: block;
    text-align: center;
}

.faq-topic-link:hover {
    background: var(--color-bg-secondary, #f0f0f0);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    color: var(--color-accent, #007bff);
    text-decoration: none;
}

/* Light mode specific adjustments for FAQ topics */
.light-mode .faq-topics {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.light-mode .faq-topic-link {
    background: white;
    border: 1px solid #e5e7eb;
}

.light-mode .faq-topic-link:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}