:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --warning: #f59e0b;
    --shadow: rgba(0, 0, 0, 0.3);
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: var(--surface);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px var(--shadow);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

.header-content {
    margin-bottom: 30px;
}

.header-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Stats */
.stats {
    display: flex;
    gap: 30px;
    margin-top: 24px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 24px;
    background: var(--surface-light);
    border-radius: 12px;
    min-width: 120px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filters */
.filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-container {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 14px 20px;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.search-btn {
    padding: 14px 24px;
    background: var(--gradient);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 12px 16px;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-secondary);
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Questions Container */
.questions-container {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
}

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

.questions-count {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.per-page-select {
    padding: 8px 12px;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.per-page-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Questions List */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.question-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.question-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px var(--shadow);
}

.question-card.expanded {
    border-color: var(--primary-color);
    box-shadow: 0 12px 32px var(--shadow);
}

.question-header {
    padding: 24px;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s ease;
}

.question-header:hover {
    background: var(--surface-light);
}

.question-title-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.question-title {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
}

.expand-icon {
    color: var(--primary-light);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.question-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface-light);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.meta-icon {
    width: 16px;
    height: 16px;
    color: var(--primary-light);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag {
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--primary-light);
}

/* Answer Content */
.answer-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.3s ease;
    background: rgba(30, 41, 59, 0.5);
}

.answer-content.expanded {
    max-height: 10000px;
    padding: 24px;
    border-top: 1px solid var(--border);
}

.answer-text {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem;
    white-space: pre-wrap;
}

.answer-text strong {
    color: var(--primary-light);
    font-weight: 600;
}

.answer-text h3,
.answer-text h4 {
    color: var(--text-primary);
    margin: 16px 0 8px;
}

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

.answer-text li {
    margin: 8px 0;
}

.answer-text code {
    background: var(--background);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
    color: var(--primary-light);
}

.answer-text pre {
    background: var(--background);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.answer-text pre code {
    padding: 0;
    background: none;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    padding: 24px;
    background: var(--surface);
    border-radius: 12px;
}

.pagination-btn {
    padding: 10px;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-pages {
    display: flex;
    gap: 6px;
    align-items: center;
}

.page-btn {
    padding: 8px 14px;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--gradient);
    border-color: var(--primary-color);
    color: white;
    font-weight: 700;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 0 8px;
    font-size: 1.2rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

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

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    background: var(--surface);
    border-radius: 16px;
    color: var(--text-secondary);
    margin-top: 40px;
}

.footer a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .header-title {
        font-size: 2rem;
    }

    .header {
        padding: 24px;
    }

    .stats {
        gap: 12px;
    }

    .stat-item {
        min-width: auto;
        flex: 1;
    }

    .filter-group {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }

    .questions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-controls {
        width: 100%;
        justify-content: space-between;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 6px;
        padding: 16px;
    }

    .pagination-btn {
        min-width: 36px;
        height: 36px;
        padding: 8px;
    }

    .page-btn {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}
