/**
 * Стили для секции FAQ на главной странице
 * ru-openrouter.ru - публичные страницы
 */

/* ============================================
   СЕКЦИЯ FAQ
   ============================================ */
.faq-section {
    margin-top: 60px;
    margin-bottom: 40px;
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-color);
}

.faq-section > .faq-description {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* ============================================
   ГРУППЫ FAQ ПО КАТЕГОРИЯМ
   ============================================ */
.faq-category-group {
    margin-bottom: 32px;
}

.faq-category-header {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.faq-category-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

/* ============================================
   АККОРДЕОН FAQ
   ============================================ */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(37, 99, 235, 0.3);
}

.faq-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
}

/* ============================================
   ЗАГОЛОВОК ВОПРОСА (КЛИКАБЕЛЬНЫЙ)
   ============================================ */
.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.2s;
}

.faq-question:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(29, 78, 216, 0.05) 100%);
}

.faq-question-text {
    flex: 1;
    padding-right: 16px;
}

.faq-question-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-color);
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-question-icon {
    background: var(--primary-color);
    color: white;
    transform: rotate(45deg);
}

/* ============================================
   ОТВЕТ (КОНТЕНТ)
   ============================================ */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.02) 0%, rgba(29, 78, 216, 0.02) 100%);
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    padding: 0 20px 20px;
    transition: max-height 0.5s ease-in, padding 0.3s ease;
}

.faq-answer-content {
    padding-top: 16px;
    color: var(--text-color);
    line-height: 1.7;
}

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

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

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

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

.faq-answer-content code {
    background: rgba(37, 99, 235, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-color);
}

.faq-answer-content pre {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    overflow-x: auto;
    margin: 12px 0;
}

.faq-answer-content pre code {
    background: transparent;
    padding: 0;
    color: var(--text-color);
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */
@media (max-width: 768px) {
    .faq-section {
        margin-top: 40px;
        margin-bottom: 30px;
    }

    .faq-category-header {
        padding-bottom: 8px;
    }

    .faq-category-title {
        font-size: 1.1rem;
    }

    .faq-question {
        padding: 14px 16px;
        font-size: 0.95rem;
    }

    .faq-answer-content {
        font-size: 0.95rem;
    }

    .faq-answer-content ul,
    .faq-answer-content ol {
        padding-left: 20px;
    }
}

@media (max-width: 480px) {
    .faq-item {
        border-radius: 8px;
    }

    .faq-question {
        padding: 12px 14px;
    }

    .faq-question-icon {
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }
}

/* ============================================
   ТЕМНАЯ ТЕМА (опционально)
   ============================================ */
@media (prefers-color-scheme: dark) {
    .faq-answer {
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(29, 78, 216, 0.08) 100%);
    }

    .faq-question:hover {
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(29, 78, 216, 0.15) 100%);
    }

    .faq-answer-content code {
        background: rgba(37, 99, 235, 0.2);
    }

    .faq-answer-content pre {
        background: rgba(0, 0, 0, 0.2);
    }
}
