:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 1rem;
}

.nav a {
    color: var(--gray-600);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav a:hover, .nav a.active {
    background: var(--primary);
    color: white;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid var(--gray-300);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-800);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-success:hover {
    background: #15803d;
}

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

.btn-danger:hover {
    background: #b91c1c;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-checkbox input {
    width: 1rem;
    height: 1rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

.table tr:hover {
    background: var(--gray-50);
}

/* Grid */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-gray {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid var(--gray-300);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Quiz Styles */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.question-card {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid var(--gray-300);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.question-number {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--gray-800);
}

.question-image {
    max-width: 100%;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.answer-option {
    display: block;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--gray-50);
}

.answer-option:hover {
    border-color: var(--primary);
    background: white;
}

.answer-option.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.answer-option.correct {
    border-color: var(--success);
    background: #dcfce7;
}

.answer-option.incorrect {
    border-color: var(--danger);
    background: #fee2e2;
}

.answer-option input {
    display: none;
}

/* Results */
.results-summary {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 0.75rem;
    border: 1px solid var(--gray-300);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.results-score {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
}

.results-text {
    font-size: 1.25rem;
    color: var(--gray-600);
}

/* Category Cards */
.category-card {
    background: white;
    border-radius: 0.75rem;
    border: 2px solid var(--gray-300);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.15);
    border-color: var(--primary);
}

.category-card h3 {
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.category-card p {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.category-card .meta {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.875rem;
}

/* File List */
.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--gray-300);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.file-icon {
    font-size: 1.5rem;
}

.file-info {
    flex: 1;
}

.file-title {
    font-weight: 500;
    color: var(--gray-800);
}

.file-desc {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Actions */
.actions {
    display: flex;
    gap: 0.5rem;
}

/* Spacing */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }

/* Text */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-small { font-size: 0.875rem; }

/* Flex */
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Image Preview */
.image-preview {
    max-width: 200px;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}

/* Progress */
.progress-bar {
    height: 0.5rem;
    background: var(--gray-300);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-400);
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}
