/* FAQ Page Specific Styles */

/* Back to Home Button */
.back-home-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.back-home-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateX(-2px);
}

.back-home-btn svg {
    transition: transform 0.2s;
}

.back-home-btn:hover svg {
    transform: translateX(-2px);
}

/* Main Content */
main {
    padding: 32px 24px;
    min-height: 400px;
}

/* Loading State */
.faq-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6b7280;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.faq-loading p {
    margin-top: 16px;
    font-size: 0.95rem;
}

/* Error State */
.faq-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.faq-error h3 {
    color: #dc2626;
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.faq-error p {
    color: #6b7280;
    margin-bottom: 20px;
}

.retry-btn {
    padding: 10px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.retry-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Category Filter */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.category-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.category-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

.category-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* FAQ List */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* FAQ Item (Accordion) */
.faq-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.faq-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Question Button */
.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: white;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.faq-question:hover {
    background: #f9fafb;
}

.question-text {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.5;
    padding-right: 16px;
}

.faq-question .toggle-icon {
    flex-shrink: 0;
    font-size: 0.875rem;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.faq-question.active .toggle-icon {
    transform: rotate(180deg);
}

/* Answer Content */
.faq-answer {
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.answer-content {
    padding: 0 20px 20px 20px;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.75;
}

/* Answer HTML Formatting */
.answer-content p {
    margin-bottom: 12px;
}

.answer-content p:last-child {
    margin-bottom: 0;
}

.answer-content ul,
.answer-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.answer-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.answer-content li:last-child {
    margin-bottom: 0;
}

.answer-content strong {
    font-weight: 600;
    color: #1f2937;
}

.answer-content em {
    font-style: italic;
}

.answer-content a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s;
}

.answer-content a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* FAQ Cross-Link Styles */
.answer-content a.faq-link {
    color: #7c3aed !important; /* Darker purple - !important to override strong tag */
    font-weight: 600; /* Bolder text */
    text-decoration: underline; /* Add underline to make it obvious */
    text-decoration-color: rgba(124, 58, 237, 0.3);
    text-underline-offset: 2px;
    position: relative;
    padding-right: 18px;
    transition: all 0.2s;
}

/* Force purple color on all child elements (like <strong>) within faq-link */
.answer-content a.faq-link * {
    color: #7c3aed !important;
}

.answer-content a.faq-link::after {
    content: '↗';
    position: absolute;
    right: 2px;
    font-size: 0.9em;
    opacity: 0.8;
    transition: transform 0.2s, opacity 0.2s;
}

.answer-content a.faq-link:hover {
    color: #6d28d9 !important;
    text-decoration-color: rgba(124, 58, 237, 0.6);
}

/* Force hover color on child elements too */
.answer-content a.faq-link:hover * {
    color: #6d28d9 !important;
}

.answer-content a.faq-link:hover::after {
    transform: translate(2px, -2px);
    opacity: 1;
}

.answer-content code {
    padding: 2px 6px;
    background: #f3f4f6;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.answer-content h1,
.answer-content h2,
.answer-content h3,
.answer-content h4 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1f2937;
}

.answer-content h1 { font-size: 1.5rem; }
.answer-content h2 { font-size: 1.25rem; }
.answer-content h3 { font-size: 1.1rem; }
.answer-content h4 { font-size: 1rem; }

/* Empty State */
.faq-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        padding: 24px 16px;
    }

    .back-home-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .back-home-btn svg {
        width: 16px;
        height: 16px;
    }

    .category-filter {
        gap: 8px;
    }

    .category-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .faq-question {
        padding: 16px;
    }

    .question-text {
        font-size: 0.95rem;
    }

    .answer-content {
        padding: 0 16px 16px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .back-home-btn {
        width: 100%;
        justify-content: center;
    }

    .category-filter {
        gap: 6px;
    }

    .category-btn {
        font-size: 0.8rem;
    }

    .question-text {
        font-size: 0.9rem;
    }

    .answer-content {
        font-size: 0.875rem;
    }
}
