/* ==========================================================================
   FAQ PAGE - "ЧЕСТО ЗАДАВАНИ ВЪПРОСИ"
   ==========================================================================

   Dependencies: This file requires homepage_sections/base.css to be loaded
   first (via the template) for --hp-* variables.

   Design: Professional FAQ page with accordion-style questions, category
   filtering, and search functionality. Matches the privacy page aesthetic
   for brand consistency.

   SOLID Principles Compliance:
   ─────────────────────────────
   S - Single Responsibility: Each CSS section handles one component type
   O - Open/Closed: CSS variables allow extension without modification
   D - Dependency Inversion: Depends on abstract --hp-* and --faq-* vars

   Architecture:
   ─────────────
   1. CSS Custom Properties (lines 25-50): Centralized design tokens
   2. Hero Section: Page header with search and CTA
   3. Category Navigation: Filterable category buttons
   4. FAQ Accordion: Expandable question/answer pairs
   5. Responsive Breakpoints: Mobile-first adjustments
   6. Accessibility: Reduced motion and print styles

   Naming Convention: BEM-like with `faq-` namespace to prevent conflicts
   - Block: .faq-section
   - Element: .faq-section-header
   - Modifier: .faq-item.active

   ========================================================================== */

/* ==========================================================================
   CSS CUSTOM PROPERTIES (SCOPED TO FAQ PAGE)
   ========================================================================== */

.faq-hero,
.faq-main {
    /* Typography optimized for FAQ readability */
    --faq-text-body: 1rem;
    --faq-text-small: 0.9375rem;
    --faq-line-height: 1.75;

    /* Section spacing */
    --faq-section-gap: 48px;
    --faq-item-gap: 12px;

    /* Card styling - matches privacy page */
    --faq-card-bg: rgba(22, 32, 34, 0.6);
    --faq-card-border: rgba(255, 255, 255, 0.08);
    --faq-card-hover-border: rgba(0, 157, 165, 0.3);

    /* Accordion specific */
    --faq-question-padding: 24px;
    --faq-answer-padding: 0 24px 24px 24px;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.faq-hero {
    position: relative;
    background: linear-gradient(135deg, var(--hp-bg-dark) 0%, var(--hp-bg-dark-surface) 50%, var(--hp-bg-dark) 100%);
    padding: 160px 0 80px;
    overflow: hidden;
}

.faq-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--hp-border-subtle) 1px, transparent 1px),
        linear-gradient(90deg, var(--hp-border-subtle) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.4;
    pointer-events: none;
}

.faq-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    height: 60%;
    background: radial-gradient(ellipse at top, rgba(0, 157, 165, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.faq-hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
    text-align: center;
}

.faq-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--hp-accent-light);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 28px;
}

.faq-eyebrow i {
    font-size: 1rem;
}

.faq-hero-title {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--hp-text-primary);
    margin-bottom: 24px;
    letter-spacing: -0.03em;
}

.faq-hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.75;
    color: var(--hp-text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

/* ==========================================================================
   SEARCH BAR
   ========================================================================== */

.faq-search-wrapper {
    max-width: 560px;
    margin: 0 auto 32px;
}

.faq-search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.faq-search-icon {
    position: absolute;
    left: 20px;
    color: var(--hp-text-tertiary);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.faq-search-input {
    width: 100%;
    padding: 18px 50px 18px 52px;
    background: var(--faq-card-bg);
    border: 1px solid var(--faq-card-border);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    color: var(--hp-text-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.faq-search-input::placeholder {
    color: var(--hp-text-tertiary);
}

.faq-search-input:focus {
    outline: none;
    border-color: var(--hp-accent);
    box-shadow: 0 0 0 4px rgba(0, 157, 165, 0.15);
}

.faq-search-input:focus + .faq-search-icon,
.faq-search-container:focus-within .faq-search-icon {
    color: var(--hp-accent);
}

.faq-search-clear {
    position: absolute;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--hp-text-tertiary);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.faq-search-clear:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--hp-text-primary);
}

.faq-search-results {
    display: none;
    margin-top: 12px;
    text-align: left;
}

.faq-search-count {
    font-size: 0.875rem;
    color: var(--hp-accent-light);
    font-weight: 500;
}

.faq-search-no-results {
    font-size: 0.875rem;
    color: var(--hp-text-tertiary);
}

/* ==========================================================================
   CONTACT CTA BUTTON
   ========================================================================== */

.faq-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: transparent;
    border: 2px solid var(--hp-accent);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--hp-accent-light);
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.faq-contact-btn:hover {
    background: var(--hp-accent);
    color: var(--hp-text-primary);
    transform: translateY(-2px);
}

.faq-contact-btn i {
    font-size: 1rem;
}

/* ==========================================================================
   MAIN CONTENT LAYOUT
   ========================================================================== */

.faq-main {
    position: relative;
    background: var(--hp-bg-dark-elevated);
    padding: 60px 0 120px;
    min-height: 100vh;
}

.faq-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ==========================================================================
   CATEGORY NAVIGATION
   ========================================================================== */

.faq-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 56px;
    padding: 24px;
    background: var(--faq-card-bg);
    border: 1px solid var(--faq-card-border);
    border-radius: var(--radius-xl);
}

.faq-category-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hp-text-secondary);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.faq-category-btn i {
    font-size: 0.9rem;
    color: var(--hp-text-tertiary);
    transition: color 0.2s ease;
}

.faq-category-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--hp-text-primary);
}

.faq-category-btn:hover i {
    color: var(--hp-accent);
}

.faq-category-btn.active {
    background: rgba(0, 157, 165, 0.15);
    border-color: rgba(0, 157, 165, 0.3);
    color: var(--hp-text-primary);
}

.faq-category-btn.active i {
    color: var(--hp-accent-light);
}

/* ==========================================================================
   FAQ SECTIONS
   ========================================================================== */

.faq-content {
    display: flex;
    flex-direction: column;
    gap: var(--faq-section-gap);
}

.faq-section {
    scroll-margin-top: 120px;
}

.faq-section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--faq-card-border);
}

.faq-section-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(0, 157, 165, 0.2), rgba(0, 157, 165, 0.05));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hp-accent-light);
    font-size: 1.5rem;
}

.faq-section-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hp-text-primary);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.faq-section-title p {
    font-size: 0.9rem;
    color: var(--hp-text-tertiary);
    margin: 0;
}

/* ==========================================================================
   FAQ ACCORDION
   ========================================================================== */

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: var(--faq-item-gap);
}

.faq-item {
    background: var(--faq-card-bg);
    border: 1px solid var(--faq-card-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
    border-color: var(--faq-card-hover-border);
}

.faq-item.active {
    border-color: var(--hp-accent);
    box-shadow: 0 4px 24px rgba(0, 157, 165, 0.1);
}

.faq-item-highlight {
    border-color: var(--hp-accent) !important;
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: var(--faq-question-padding);
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.faq-question-text {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--hp-text-primary);
    line-height: 1.5;
}

.faq-question-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: rgba(0, 157, 165, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hp-accent);
    font-size: 0.75rem;
    transition: transform 0.3s ease, background 0.3s ease;
}

.faq-item.active .faq-question-icon {
    transform: rotate(180deg);
    background: var(--hp-accent);
    color: var(--hp-text-primary);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.faq-answer-content {
    padding: var(--faq-answer-padding);
    color: var(--hp-text-secondary);
    font-size: var(--faq-text-body);
    line-height: var(--faq-line-height);
}

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

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

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

.faq-answer-content a {
    color: var(--hp-accent-light);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.faq-answer-content a:hover {
    color: var(--hp-accent);
}

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

.faq-answer-content li {
    margin-bottom: 10px;
    padding-left: 8px;
}

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

.faq-answer-content li::marker {
    color: var(--hp-accent);
}

/* ==========================================================================
   PLAN CARDS (INSIDE FAQ)
   ========================================================================== */

.faq-plan-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.faq-plan-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--faq-card-border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: border-color 0.2s ease;
}

.faq-plan-card:hover {
    border-color: var(--faq-card-hover-border);
}

.faq-plan-card.featured {
    border-color: var(--hp-accent);
    background: rgba(0, 157, 165, 0.08);
}

.faq-plan-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--hp-text-primary);
    margin-bottom: 10px;
}

.faq-plan-card.featured h4 {
    color: var(--hp-accent-light);
}

.faq-plan-card p {
    font-size: 0.875rem;
    color: var(--hp-text-tertiary);
    line-height: 1.6;
    margin: 0;
}

/* ==========================================================================
   WARNING BOX
   ========================================================================== */

.faq-warning {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 16px;
    padding: 16px 20px;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: var(--radius-md);
}

.faq-warning i {
    flex-shrink: 0;
    color: var(--hp-orange);
    font-size: 1.1rem;
    margin-top: 2px;
}

.faq-warning p {
    font-size: 0.9rem;
    color: var(--hp-text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ==========================================================================
   CTA SECTION
   ========================================================================== */

.faq-cta-section {
    margin-top: var(--faq-section-gap);
    padding-top: var(--faq-section-gap);
    border-top: 1px solid var(--faq-card-border);
}

.faq-cta-content {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 48px 40px;
    background: linear-gradient(135deg, rgba(0, 157, 165, 0.1), rgba(0, 157, 165, 0.02));
    border: 1px solid rgba(0, 157, 165, 0.2);
    border-radius: var(--radius-xl);
}

.faq-cta-icon {
    width: 72px;
    height: 72px;
    background: var(--hp-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 1.75rem;
    color: var(--hp-text-primary);
}

.faq-cta-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hp-text-primary);
    margin-bottom: 12px;
}

.faq-cta-content p {
    font-size: 1rem;
    color: var(--hp-text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
}

.faq-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: var(--hp-accent);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    color: var(--hp-text-primary);
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.faq-cta-btn:hover {
    background: var(--hp-accent-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 157, 165, 0.3);
}

.faq-cta-btn i {
    font-size: 1rem;
}

/* ==========================================================================
   BACK TO TOP BUTTON
   ========================================================================== */

.faq-back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 52px;
    height: 52px;
    background: var(--hp-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hp-text-primary);
    font-size: 1.25rem;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
    z-index: var(--z-fixed);
    box-shadow: var(--hp-shadow-md);
}

.faq-back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.faq-back-to-top:hover {
    background: var(--hp-accent-light);
    transform: translateY(-4px);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1024px) {
    .faq-plan-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .faq-hero {
        padding: 140px 0 60px;
    }

    .faq-hero-content,
    .faq-container {
        padding: 0 24px;
    }

    .faq-hero-title {
        font-size: 2rem;
    }

    .faq-hero-subtitle {
        font-size: 1.1rem;
    }

    .faq-search-input {
        padding: 16px 48px 16px 48px;
        font-size: 0.95rem;
    }

    .faq-categories {
        gap: 8px;
        padding: 16px;
    }

    .faq-category-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .faq-category-btn span {
        display: none;
    }

    .faq-category-btn i {
        font-size: 1rem;
    }

    .faq-section-header {
        gap: 16px;
    }

    .faq-section-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

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

    .faq-question {
        padding: 20px;
    }

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

    .faq-answer-content {
        padding: 0 20px 20px 20px;
    }

    .faq-main {
        padding: 48px 0 80px;
    }

    .faq-cta-content {
        padding: 36px 24px;
    }

    .faq-back-to-top {
        bottom: 24px;
        right: 24px;
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .faq-hero {
        padding: 120px 0 48px;
    }

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

    .faq-categories {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

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

    .faq-category-btn {
        flex-shrink: 0;
    }

    .faq-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .faq-contact-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .faq-item,
    .faq-question,
    .faq-question-icon,
    .faq-answer,
    .faq-back-to-top,
    .faq-category-btn,
    .faq-contact-btn,
    .faq-cta-btn {
        transition: none;
    }

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

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .faq-hero {
        background: #fff;
        padding: 40px 0;
    }

    .faq-hero::before,
    .faq-hero::after {
        display: none;
    }

    .faq-hero-title,
    .faq-section-title h2,
    .faq-question-text {
        color: #000;
    }

    .faq-hero-subtitle,
    .faq-answer-content {
        color: #333;
    }

    .faq-search-wrapper,
    .faq-contact-btn,
    .faq-categories,
    .faq-back-to-top,
    .faq-cta-section {
        display: none;
    }

    .faq-main {
        background: #fff;
        padding: 20px 0;
    }

    .faq-item {
        border: 1px solid #ccc;
        page-break-inside: avoid;
        margin-bottom: 16px;
    }

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

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