/* ============================================
   AUTOMATDO FAQ PAGE STYLES
   Editorial/Magazine aesthetic with elegant accordions
   ============================================ */

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: var(--answer-height, 500px);
    }
}

/* ---------- FAQ Page Base ---------- */
.faq-page {
    position: relative;
    z-index: 10;
}

/* ---------- FAQ Header Section ---------- */
.faq-header-section {
    padding: 12rem 0 var(--space-3xl);
}

.faq-header {
    max-width: 680px;
    animation: fadeInUp 0.7s ease-out;
}

.faq-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.faq-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.faq-contact-link {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--transition-fast);
}

.faq-contact-link:hover {
    color: var(--accent-secondary);
}

/* ---------- FAQ Content Section ---------- */
.faq-content-section {
    padding: 0 0 var(--space-4xl);
}

/* ---------- FAQ Layout ---------- */
.faq-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-3xl);
    align-items: start;
}

/* ---------- FAQ Navigation (Category Sidebar) ---------- */
.faq-nav {
    position: sticky;
    top: 100px;
    animation: fadeIn 0.6s ease-out 0.2s backwards;
}

.faq-nav-inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.faq-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: left;
}

.faq-nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.faq-nav-item.active {
    color: var(--accent-primary);
    background: rgba(212, 165, 48, 0.08);
    border-color: rgba(212, 165, 48, 0.2);
}

[data-theme="light"] .faq-nav-item.active {
    background: rgba(184, 145, 42, 0.08);
    border-color: rgba(184, 145, 42, 0.2);
}

.faq-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.faq-nav-item.active .faq-nav-icon {
    background: rgba(212, 165, 48, 0.15);
    color: var(--accent-primary);
}

.faq-nav-icon svg {
    width: 18px;
    height: 18px;
}

.faq-nav-label {
    flex: 1;
}

/* ---------- FAQ Panels ---------- */
.faq-panels {
    animation: fadeInUp 0.7s ease-out 0.15s backwards;
}

.faq-panel {
    display: none;
}

.faq-panel.active {
    display: block;
}

/* ---------- FAQ List ---------- */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ---------- FAQ Item ---------- */
.faq-item {
    border-bottom: 1px solid var(--border-subtle);
    animation: fadeInUp 0.5s ease-out backwards;
}

.faq-item:first-child {
    border-top: 1px solid var(--border-subtle);
}

/* Staggered animation delays */
.faq-item[data-index="0"] { animation-delay: 0.05s; }
.faq-item[data-index="1"] { animation-delay: 0.1s; }
.faq-item[data-index="2"] { animation-delay: 0.15s; }
.faq-item[data-index="3"] { animation-delay: 0.2s; }
.faq-item[data-index="4"] { animation-delay: 0.25s; }
.faq-item[data-index="5"] { animation-delay: 0.3s; }

/* ---------- FAQ Question Button ---------- */
.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    width: 100%;
    padding: var(--space-xl) 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: color var(--transition-fast);
    position: relative;
}

.faq-question::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-full);
    transition: height var(--transition-base);
}

.faq-question:hover {
    color: var(--accent-primary);
}

.faq-item.open .faq-question::before {
    height: 24px;
}

.faq-question-text {
    flex: 1;
    line-height: 1.5;
}

/* ---------- FAQ Icon (Plus/Minus) ---------- */
.faq-icon {
    position: relative;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.faq-icon-line {
    position: absolute;
    background: var(--text-tertiary);
    border-radius: 1px;
    transition: all var(--transition-base);
}

.faq-icon-horizontal {
    width: 14px;
    height: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.faq-icon-vertical {
    width: 2px;
    height: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.faq-question:hover .faq-icon-line {
    background: var(--accent-primary);
}

.faq-item.open .faq-icon-vertical {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

.faq-item.open .faq-icon-horizontal {
    background: var(--accent-primary);
}

/* ---------- FAQ Answer ---------- */
.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--transition-slow);
}

.faq-item.open .faq-answer {
    grid-template-rows: 1fr;
}

.faq-answer-inner {
    overflow: hidden;
}

.faq-answer-inner p {
    padding-bottom: var(--space-xl);
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 720px;
}

/* ---------- FAQ CTA Section ---------- */
.faq-cta {
    position: relative;
    z-index: 10;
    padding: var(--space-4xl) 0;
}

/* Reuse CTA card styles from about.css / landing.css */
.faq-cta .cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2xl);
    padding: var(--space-2xl) var(--space-3xl);
    background: linear-gradient(135deg, rgba(212, 165, 48, 0.1) 0%, rgba(212, 165, 48, 0.02) 100%);
    border: 1px solid rgba(212, 165, 48, 0.2);
    border-radius: var(--radius-xl);
    animation: fadeInUp 0.7s ease-out;
}

[data-theme="light"] .faq-cta .cta-card {
    background: linear-gradient(135deg, rgba(184, 145, 42, 0.08) 0%, rgba(184, 145, 42, 0.02) 100%);
    box-shadow: var(--shadow-lg);
}

.faq-cta .cta-content {
    max-width: 550px;
}

.faq-cta .cta-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: var(--space-sm);
}

.faq-cta .cta-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-cta .cta-actions {
    display: flex;
    gap: var(--space-md);
    flex-shrink: 0;
}

/* ---------- Responsive Styles ---------- */
@media (max-width: 1024px) {
    .faq-layout {
        grid-template-columns: 200px 1fr;
        gap: var(--space-2xl);
    }
}

@media (max-width: 768px) {
    .faq-header-section {
        padding: 9rem 0 var(--space-2xl);
    }

    .faq-layout {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .faq-nav {
        position: static;
        overflow-x: auto;
        margin: 0 calc(-1 * var(--space-xl));
        padding: 0 var(--space-xl);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .faq-nav::-webkit-scrollbar {
        display: none;
    }

    .faq-nav-inner {
        flex-direction: row;
        gap: var(--space-sm);
        padding-bottom: var(--space-sm);
    }

    .faq-nav-item {
        flex-shrink: 0;
        padding: var(--space-sm) var(--space-md);
        border-radius: var(--radius-full);
        white-space: nowrap;
    }

    .faq-nav-icon {
        width: 28px;
        height: 28px;
    }

    .faq-nav-icon svg {
        width: 14px;
        height: 14px;
    }

    .faq-question {
        padding: var(--space-lg) 0;
        font-size: 1rem;
    }

    .faq-question::before {
        display: none;
    }

    .faq-answer-inner p {
        padding-bottom: var(--space-lg);
        font-size: 0.9375rem;
    }

    .faq-cta .cta-card {
        flex-direction: column;
        text-align: center;
        padding: var(--space-xl);
    }

    .faq-cta .cta-actions {
        flex-direction: column;
        width: 100%;
    }

    .faq-cta .cta-actions .btn-primary,
    .faq-cta .cta-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .faq-header-section {
        padding: 8rem 0 var(--space-xl);
    }

    .faq-title {
        font-size: 1.75rem;
    }

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

    .faq-nav-label {
        font-size: 0.875rem;
    }

    .faq-question {
        font-size: 0.9375rem;
        gap: var(--space-md);
    }

    .faq-icon {
        width: 20px;
        height: 20px;
    }

    .faq-icon-horizontal {
        width: 12px;
    }

    .faq-icon-vertical {
        height: 12px;
    }
}
