/**
 * FAQ Page Styles
 *
 * Styles for the NEXMO FAQ page with accordion sections.
 *
 * @package Astra Child
 */

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

/* Main page wrapper - full width */
.faq-page {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
}

.faq-page .site-main {
    padding: 0;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    min-height: 100vh;
}

/* Centered content container */
.faq-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 1.5rem 4rem;
}

/* Override Astra theme constraints */
#primary.faq-page {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    float: none;
}

.ast-separate-container #primary.faq-page,
.ast-plain-container #primary.faq-page {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.ast-separate-container #primary.faq-page .ast-article-single,
.ast-plain-container #primary.faq-page .ast-article-single {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

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

.faq-header {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.faq-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.faq-intro {
    font-size: 1.125rem;
    color: #64748b;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto 1.5rem;
}

/* Search */
.faq-search-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

#faq-search {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    transition: all 0.2s ease;
}

#faq-search:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#faq-search::placeholder {
    color: #94a3b8;
}

.faq-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

/* ============================================
   FAQ Navigation
   ============================================ */

.faq-nav {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.faq-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
}

.faq-nav li {
    margin: 0;
}

.faq-nav a {
    display: inline-block;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    background: #f1f5f9;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.faq-nav a:hover {
    background: #3b82f6;
    color: #fff;
}

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

.faq-section {
    margin-bottom: 2.5rem;
}

.faq-section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 1.375rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    border-radius: 8px;
    flex-shrink: 0;
}

/* ============================================
   FAQ Items (Accordion)
   ============================================ */

.faq-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.faq-item.active {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

/* Question Button */
.faq-question {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.125rem 1.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    transition: background 0.2s ease;
}

.faq-question:hover {
    background: #f8fafc;
}

.faq-item.active .faq-question {
    background: #f0f7ff;
}

.question-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: #94a3b8;
    flex-shrink: 0;
    min-width: 1.75rem;
}

.question-text {
    flex: 0 1 auto;
    font-size: 1rem;
    font-weight: 500;
    color: #334155;
    line-height: 1.5;
    text-align: center;
}

.faq-item.active .question-text {
    color: #1e40af;
}

/* Icon */
.faq-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    position: relative;
    margin-top: 0.125rem;
}

.faq-icon::before,
.faq-icon::after {
    content: '';
    position: absolute;
    background: #94a3b8;
    border-radius: 2px;
    transition: all 0.25s ease;
}

.faq-icon::before {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.faq-icon::after {
    width: 2px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.faq-item.active .faq-icon::before {
    background: #3b82f6;
}

.faq-item.active .faq-icon::after {
    transform: translateX(-50%) rotate(90deg);
    opacity: 0;
}

/* Answer */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer p {
    padding: 0 2rem 1.25rem 2rem;
    margin: 0;
    font-size: 0.9375rem;
    color: #475569;
    line-height: 1.75;
    text-align: center;
}

/* ============================================
   Glossary
   ============================================ */

.faq-glossary .section-number {
    background: linear-gradient(135deg, #10b981, #059669);
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.glossary-item {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.glossary-item:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.glossary-item dt {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.glossary-item dd {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   Back to Top
   ============================================ */

.faq-back-to-top {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.back-to-top-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #3b82f6;
    background: #eff6ff;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.back-to-top-link:hover {
    background: #3b82f6;
    color: #fff;
}

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

@media (max-width: 768px) {
    .faq-page {
        padding: 1.5rem 1rem 3rem;
    }

    .faq-header h1 {
        font-size: 1.875rem;
    }

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

    .faq-nav {
        padding: 1rem;
    }

    .faq-nav a {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    .faq-section-title {
        font-size: 1.125rem;
        gap: 0.75rem;
    }

    .section-number {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }

    .faq-question {
        padding: 1rem;
    }

    .question-text {
        font-size: 0.9375rem;
    }

    .faq-answer p {
        padding: 0 1rem 1rem 1rem;
        font-size: 0.875rem;
    }

    .glossary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .faq-header h1 {
        font-size: 1.5rem;
    }

    .faq-nav ul {
        gap: 0.375rem;
    }

    .faq-nav a {
        padding: 0.25rem 0.5rem;
        font-size: 0.6875rem;
    }
}

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

@media print {
    .faq-nav,
    .faq-search-wrapper,
    .faq-back-to-top {
        display: none;
    }

    .faq-answer {
        max-height: none !important;
    }

    .faq-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
