/**
 * FAQ Page Styles
 * Styles for the Frequently Asked Questions page
 */

/* ==========================================================================
   FAQ Container
   ========================================================================== */

.faq-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ==========================================================================
   FAQ Header
   ========================================================================== */

.faq-header {
    margin-bottom: 3rem;
}

.faq-header .display-4 {
    color: #2c3e50;
    font-weight: 700;
}

.faq-header .lead {
    font-size: 1.25rem;
    color: #6c757d;
}

/* ==========================================================================
   Quick Links Card
   ========================================================================== */

.faq-quick-links {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.faq-quick-links .card-title {
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
}

.quick-link {
    display: block;
    color: white;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.quick-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateX(5px);
}

.quick-link i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

/* ==========================================================================
   FAQ Sections
   ========================================================================== */

.faq-section {
    scroll-margin-top: 100px; /* Offset for fixed header + padding */
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #667eea;
}

.section-title i {
    color: #667eea;
}

/* ==========================================================================
   FAQ Items - Improved Contrast
   ========================================================================== */

.faq-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.faq-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
    background: white;
}

.faq-question {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 1rem;
    cursor: default;
}

.faq-answer {
    color: #4a5568;
    line-height: 1.7;
    font-size: 1rem;
}

.faq-answer p {
    margin-bottom: 1rem;
    color: #2d3748;
}

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

.faq-answer ul,
.faq-answer ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.faq-answer li {
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.faq-answer a {
    color: #5a67d8;
    text-decoration: underline;
    font-weight: 500;
}

.faq-answer a:hover {
    color: #4c51bf;
}

.faq-answer strong {
    color: #1a202c;
    font-weight: 600;
}

/* ==========================================================================
   CTA Card - Now styled as FAQ item
   ========================================================================== */

.faq-cta.faq-item {
    margin-top: 3rem;
    text-align: center;
}

.faq-cta .faq-question {
    margin-bottom: 1rem;
    cursor: default;
}

.faq-cta .faq-answer {
    margin-top: 1rem;
}

.faq-cta .btn {
    font-weight: 600;
    padding: 0.75rem 2rem;
    min-width: 200px;
}

.faq-cta .btn-outline-primary:hover {
    color: white;
}

.faq-cta .gap-2 {
    gap: 0.5rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .faq-container {
        padding: 1rem 0.5rem;
    }

    .faq-header .display-4 {
        font-size: 2rem;
    }

    .faq-header .lead {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .faq-question {
        font-size: 1.1rem;
        cursor: pointer;
        position: relative;
        padding-right: 2rem;
    }

    .faq-question::after {
        content: '\F282'; /* Bootstrap icon chevron-down */
        font-family: 'bootstrap-icons';
        position: absolute;
        right: 0;
        top: 0;
        transition: transform 0.3s ease;
    }

    .faq-question.active::after {
        transform: rotate(180deg);
    }

    .faq-answer {
        display: none;
        animation: fadeIn 0.3s ease;
    }

    .faq-item {
        padding: 1rem;
    }

    .quick-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.25rem;
    }

    .faq-cta .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        min-width: auto;
    }

    .faq-cta .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Keep CTA question visible and not collapsible */
    .faq-cta .faq-question {
        cursor: default;
        padding-right: 0;
    }
    
    .faq-cta .faq-question::after {
        display: none;
    }
    
    .faq-cta .faq-answer {
        display: block;
    }
}

@media (max-width: 576px) {
    .faq-header {
        margin-bottom: 2rem;
    }

    .faq-header .display-4 {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .faq-question {
        font-size: 1rem;
    }

    .faq-answer {
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */

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

.faq-item {
    animation: fadeIn 0.4s ease;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .faq-quick-links,
    .faq-cta,
    .quick-link {
        display: none !important;
    }

    .faq-item {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #000;
        background: white !important;
    }

    .faq-answer {
        display: block !important;
    }

    .section-title {
        page-break-after: avoid;
    }

    .faq-question,
    .faq-answer,
    .faq-answer p,
    .faq-answer li {
        color: #000 !important;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .faq-item,
    .quick-link {
        animation: none;
        transition: none;
    }

    .faq-item:hover {
        transform: none;
    }

    .quick-link:hover {
        transform: none;
    }

    .faq-answer {
        animation: none;
    }
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: high) {
    .faq-item {
        border-width: 2px;
        border-color: #000;
    }

    .faq-question,
    .faq-answer,
    .faq-answer p,
    .faq-answer li {
        color: #000;
    }

    .section-title {
        border-bottom-width: 4px;
    }

    .faq-answer a {
        color: #0000EE;
        text-decoration: underline;
        text-decoration-thickness: 2px;
    }
}

/* ==========================================================================
   Dark Mode Support (Manual Toggle)
   ========================================================================== */

[data-theme="dark"] .faq-item {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .faq-item:hover {
    background: #1a202c;
    border-color: #667eea;
}

[data-theme="dark"] .faq-question {
    color: #f7fafc;
}

[data-theme="dark"] .faq-answer,
[data-theme="dark"] .faq-answer p,
[data-theme="dark"] .faq-answer li {
    color: #cbd5e0;
}

[data-theme="dark"] .faq-answer strong {
    color: #e2e8f0;
}

[data-theme="dark"] .faq-answer a {
    color: #90cdf4;
}

[data-theme="dark"] .faq-answer a:hover {
    color: #63b3ed;
}

[data-theme="dark"] .section-title {
    color: #f7fafc;
}

[data-theme="dark"] .faq-header .display-4 {
    color: #f7fafc;
}

[data-theme="dark"] .faq-header .lead {
    color: #a0aec0;
}

/* CTA inherits faq-item dark mode styles automatically */
[data-theme="dark"] .faq-cta.faq-item {
    /* Inherits from .faq-item dark mode styles above */
}

/* ==========================================================================
   Also support system preference when theme is set to auto
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .faq-item {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    html:not([data-theme="light"]) .faq-item:hover {
        background: #1a202c;
        border-color: #667eea;
    }

    html:not([data-theme="light"]) .faq-question {
        color: #f7fafc;
    }

    html:not([data-theme="light"]) .faq-answer,
    html:not([data-theme="light"]) .faq-answer p,
    html:not([data-theme="light"]) .faq-answer li {
        color: #cbd5e0;
    }

    html:not([data-theme="light"]) .faq-answer strong {
        color: #e2e8f0;
    }

    html:not([data-theme="light"]) .faq-answer a {
        color: #90cdf4;
    }

    html:not([data-theme="light"]) .faq-answer a:hover {
        color: #63b3ed;
    }

    html:not([data-theme="light"]) .section-title {
        color: #f7fafc;
    }

    html:not([data-theme="light"]) .faq-header .display-4 {
        color: #f7fafc;
    }

    html:not([data-theme="light"]) .faq-header .lead {
        color: #a0aec0;
    }
}
