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

:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: var(--gradient-primary);
    color: white;
    padding: 60px 0;
    margin: 0 -20px 40px -20px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    animation: fadeInUp 0.8s ease-out;
}

.title i {
    font-size: 2.5rem;
    opacity: 0.9;
}

.subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

.search-container {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--bg-card);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md), 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-container {
    min-width: 200px;
}

.topic-filter {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--bg-card);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.topic-filter:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md), 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Loading and Error States */
.loading-state, .error-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.error-content i {
    font-size: 3rem;
    color: #f56565;
    margin-bottom: 20px;
}

.error-content h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.retry-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* FAQ Content */
.faq-content {
    flex: 1;
    margin-bottom: 40px;
}

.faq-container {
    display: grid;
    gap: 20px;
}

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

.faq-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.faq-header {
    padding: 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    transition: var(--transition);
}

.faq-header:hover {
    background: var(--bg-secondary);
}

.faq-topic {
    display: inline-block;
    background: var(--gradient-accent);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.faq-question {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0;
}

.faq-toggle {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
    flex-shrink: 0;
    margin-top: 4px;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-content-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-item.active .faq-content-wrapper {
    max-height: 1000px;
}

.faq-answer-content {
    padding: 0 24px 24px 24px;
    border-top: 1px solid var(--border-color);
}

.faq-answer {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.faq-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.faq-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.no-results-content i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.no-results-content h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.no-results-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Pagination Styles */
.pagination-container {
    margin-top: 40px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.pagination-info {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-number {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    min-width: 44px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-number:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.page-number.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.page-number.active:hover {
    transform: none;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 10px 8px;
    font-weight: 500;
}

/* Pagination Responsive */
@media (max-width: 768px) {
    .pagination-container {
        margin-top: 30px;
        padding: 20px;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 16px;
    }
    
    .pagination-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .page-numbers {
        order: -1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .pagination-container {
        padding: 16px;
    }
    
    .page-numbers {
        gap: 4px;
    }
    
    .page-number {
        padding: 8px 12px;
        min-width: 36px;
        font-size: 0.875rem;
    }
    
    .pagination-btn {
        padding: 10px 16px;
        font-size: 0.875rem;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        margin: 0 -16px 30px -16px;
        padding: 40px 0;
    }
    
    .title {
        font-size: 2rem;
        flex-direction: column;
        gap: 12px;
    }
    
    .title i {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .search-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .filter-container {
        min-width: auto;
        width: 100%;
    }
    
    .faq-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .faq-toggle {
        position: absolute;
        top: 20px;
        right: 20px;
        margin-top: 0;
    }
    
    .faq-question {
        font-size: 1.1rem;
        padding-right: 40px;
    }
    
    .faq-answer-content {
        padding: 0 20px 20px 20px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.75rem;
    }
    
    .faq-header {
        padding: 16px;
    }
    
    .faq-toggle {
        top: 16px;
        right: 16px;
    }
    
    .faq-question {
        padding-right: 36px;
    }
    
    .faq-answer-content {
        padding: 0 16px 16px 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f7fafc;
        --text-secondary: #e2e8f0;
        --text-muted: #a0aec0;
        --bg-primary: #1a202c;
        --bg-secondary: #2d3748;
        --bg-card: #2d3748;
        --border-color: #4a5568;
    }
    
    body {
        background: var(--bg-primary);
    }
}

/* Print styles */
@media print {
    .header, .search-section, .footer {
        display: none;
    }
    
    .faq-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 20px;
    }
    
    .faq-content-wrapper {
        max-height: none !important;
    }
    
    .faq-toggle {
        display: none;
    }
}

/* Image Modal Styles */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    display: flex;
    flex-direction: column;
    animation: slideInUp 0.3s ease-out;
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: var(--bg-secondary);
}

.modal-body iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 0;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: var(--bg-card);
}

.btn-primary, .btn-secondary {
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 120px;
    justify-content: center;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.image-view-btn {
    background: var(--gradient-accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
}

.image-view-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95vw;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body iframe {
        height: 400px;
    }
    
    .modal-footer {
        padding: 16px 20px;
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98vw;
        max-height: 98vh;
    }
    
    .modal-body iframe {
        height: 300px;
    }
}