/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

/* Main Container */
.faq-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Section */
.faq-header {
    text-align: center;
    margin-bottom: 40px;
}

.faq-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
}

.faq-subtitle {
    font-size: 1.125rem;
    color: #64748b;
    margin-bottom: 30px;
}

.faq-hero-image {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.faq-hero-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

/* Search Section */
.faq-search-section {
    margin-bottom: 40px;
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto 10px;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.faq-search-input {
    width: 100%;
    padding: 16px 50px 16px 50px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    background: white;
    transition: all 0.3s ease;
}

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

.search-clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 5px;
    display: none;
}

.search-clear-btn:hover {
    color: #64748b;
}

.search-hint {
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
}

/* Content Wrapper */
.faq-content-wrapper {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

/* Categories Sidebar */
.faq-categories {
    flex: 0 0 250px;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.categories-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.category-btn:hover {
    background: #e2e8f0;
    color: #334155;
}

.category-btn.active {
    background: #3b82f6;
    color: white;
}

.category-btn i {
    width: 20px;
    text-align: center;
}

.faq-stats {
    display: flex;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-item i {
    font-size: 1.5rem;
    color: #3b82f6;
    margin-bottom: 5px;
}

.stat-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
}

/* Questions Section */
.faq-questions-section {
    flex: 1;
}

.questions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.questions-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.questions-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #475569;
    cursor: pointer;
}

/* FAQ Questions List */
.faq-questions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.faq-question {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.faq-question:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.question-header {
    padding: 20px;
}

.question-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: 0;
}

.question-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.toggle-icon {
    color: #64748b;
    transition: transform 0.3s ease;
}

.question-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.question-meta {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 0.875rem;
}

.question-category {
    background: #e0f2fe;
    color: #0369a1;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.question-views {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #64748b;
}

/* FIXED: Answer display logic */
.question-answer {
    padding: 0 20px 20px;
    border-top: 1px solid #e2e8f0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.faq-question.active .question-answer {
    max-height: 1000px;
    opacity: 1;
    padding-top: 20px;
}

.question-answer p {
    margin-bottom: 20px;
    color: #475569;
}

.answer-image {
    border-radius: 8px;
    overflow: hidden;
}

.answer-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* No Results */
.faq-no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.no-results-icon {
    color: #cbd5e1;
    margin-bottom: 20px;
}

.no-results-title {
    font-size: 1.5rem;
    color: #475569;
    margin-bottom: 10px;
}

.no-results-text {
    color: #94a3b8;
}

/* Contact Section */
.faq-contact-section {
    display: flex;
    align-items: center;
    gap: 40px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    padding: 40px;
    border-radius: 12px;
    color: white;
}

.contact-content {
    flex: 1;
}

.contact-title {
    font-size: 1.75rem;
    margin-bottom: 15px;
}

.contact-text {
    margin-bottom: 25px;
    opacity: 0.9;
}

.contact-actions {
    display: flex;
    gap: 15px;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.primary-btn {
    background: white;
    color: #3b82f6;
}

.primary-btn:hover {
    background: #f8fafc;
    transform: translateY(-2px);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.contact-image {
    flex: 0 0 300px;
    border-radius: 8px;
    overflow: hidden;
}

.contact-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Footer */
.faq-footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
}

.footer-link {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #3b82f6;
}

.footer-copyright {
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .faq-content-wrapper {
        flex-direction: column;
    }
    
    .faq-categories {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .faq-title {
        font-size: 2rem;
    }
    
    .faq-hero-img {
        height: 300px;
    }
    
    .faq-contact-section {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-image {
        flex: none;
        width: 100%;
    }
    
    .questions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .contact-actions {
        flex-direction: column;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .faq-container {
        padding: 15px;
    }
    
    .faq-title {
        font-size: 1.75rem;
    }
    
    .faq-hero-img {
        height: 200px;
    }
    
    .faq-search-input {
        padding: 14px 45px 14px 45px;
    }
    
    .faq-categories {
        padding: 20px;
    }
    
    .faq-contact-section {
        padding: 30px 20px;
    }
}