/* FAQ Section Styles */
.faq-section {
    padding: var(--spacing-2xl) 0;
    background: var(--bg-secondary);
}

.faq-section .section-header {
    margin-bottom: var(--spacing-xl);
}

.faq-section .section-title {
    font-size: var(--text-3xl);
    font-weight: bold;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.faq-section .section-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.faq-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease-in-out;
}

.faq-item:hover {
    box-shadow: var(--shadow-lg);
}

/* Hide checkbox */
.faq-toggle {
    display: none;
}

/* Question styling */
.faq-question {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.3s ease-in-out;
    position: relative;
    user-select: none;
}

.faq-question:hover {
    background-color: var(--bg-tertiary);
}

.faq-question-text {
    flex-grow: 1;
    margin-right: var(--spacing-md);
}

.faq-icon {
    font-size: var(--text-xl);
    font-weight: normal;
    color: var(--primary-color);
    transition: transform 0.3s ease-in-out;
    flex-shrink: 0;
    line-height: 1;
}

/* Answer styling */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
    background-color: var(--bg-tertiary);
}

.faq-answer-content {
    padding: 0 var(--spacing-lg);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* When checkbox is checked */
.faq-toggle:checked + .faq-question {
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.faq-toggle:checked + .faq-question .faq-icon {
    transform: rotate(45deg);
    color: var(--accent-red);
}

.faq-toggle:checked ~ .faq-answer {
    max-height: 1000px; /* Tăng max-height để đảm bảo content hiển thị đầy đủ */
    padding: var(--spacing-md) 0;
}

.faq-toggle:checked ~ .faq-answer .faq-answer-content {
    opacity: 1;
}

/* Hover effects */
.faq-question:hover .faq-icon {
    color: var(--accent-red);
    transform: scale(1.1);
}

/* Focus states for accessibility */
.faq-question:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* Animation for icon rotation */
.faq-icon {
    transform-origin: center;
}

/* Responsive design */
@media (max-width: 1024px) {
    .faq-section {
        padding: var(--spacing-xl) 0;
    }
    
    .faq-section .section-title {
        font-size: var(--text-2xl);
    }
}

@media (max-width: 768px) {
    .faq-section {
        padding: var(--spacing-lg) 0;
    }
    
    .faq-section .section-title {
        font-size: var(--text-xl);
    }
    
    .faq-question {
        padding: var(--spacing-md) var(--spacing-md);
        font-size: var(--text-base);
    }
    
    .faq-answer-content {
        padding: 0 var(--spacing-md);
    }
    
    .faq-wrapper {
        max-width: 100%;
        padding: 0 var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .faq-section {
        padding: var(--spacing-md) 0;
    }
    
    .faq-section .section-title {
        font-size: var(--text-lg);
    }
    
    .faq-question {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .faq-answer-content {
        padding: 0 var(--spacing-md);
    }
    
    .faq-icon {
        font-size: var(--text-lg);
    }
    
    .faq-section .section-description {
        font-size: var(--text-base);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .faq-item {
        border: 2px solid var(--text-primary);
    }
    
    .faq-question:focus {
        outline: 3px solid var(--text-primary);
        outline-offset: -3px;
    }
    
    .faq-toggle:checked + .faq-question {
        border-bottom-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .faq-question {
        transition: none;
    }
    
    .faq-answer {
        transition: none;
    }
    
    .faq-answer-content {
        transition: none;
    }
    
    .faq-icon {
        transition: none;
    }
    
    .faq-item {
        transition: none;
    }
    
    .faq-question:hover .faq-icon {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .faq-section {
        background: white !important;
        padding: var(--spacing-md) 0;
    }
    
    .faq-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .faq-question {
        background: #f0f0f0 !important;
        color: black !important;
    }
    
    .faq-answer {
        background: white !important;
    }
    
    .faq-answer-content {
        color: black !important;
        opacity: 1 !important;
    }
    
    .faq-toggle:checked ~ .faq-answer {
        max-height: none;
        padding: var(--spacing-sm) 0;
    }
}
