/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.5;
}

/* Layout */
.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.header-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2563eb;
}

.header-subtitle {
    font-size: 0.875rem;
    color: #4b5563;
    margin-top: 0.25rem;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: #4b5563;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #2563eb;
}

.back-button {
    color: #4b5563;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Main content */
.main-content {
    padding: 2rem 0;
}

/* Category grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.category-card {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.category-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.category-icon {
    font-size: 1.5rem;
}

.category-title {
    font-size: 1.125rem;
    font-weight: 500;
}

.category-description {
    color: #4b5563;
}

/* Quiz card */
.quiz-card {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem auto;
    max-width: 48rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.quiz-question {
    font-size: 1.125rem;
    font-weight: 500;
    flex: 1;
    padding-right: 1rem;
}

.difficulty-badge {
    background-color: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.option:hover {
    background-color: #f3f4f6;
}

.option.selected {
    background-color: #dbeafe;
    border-color: #2563eb;
}

.option.correct {
    background-color: #dcfce7;
    border-color: #22c55e;
}

.option.incorrect {
    background-color: #fee2e2;
    border-color: #ef4444;
}

/* Buttons */
.button {
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.button-primary {
    background-color: #2563eb;
    color: white;
}

.button-primary:hover {
    background-color: #1e40af;
}

.button-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Results */
.results {
    text-align: center;
    padding: 2rem;
}

.results-score {
    font-size: 3rem;
    font-weight: bold;
    color: #2563eb;
    margin: 1rem 0;
}

.results-text {
    color: #4b5563;
    margin-bottom: 2rem;
}

/* Feedback section */
.feedback {
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1.5rem;
}

.feedback-correct {
    color: #22c55e;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.feedback-incorrect {
    color: #ef4444;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.feedback-explanation {
    color: #4b5563;
}

/* Quiz progress */
.quiz-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: #4b5563;
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Loading animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    position: fixed;
    inset: 0;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    color: #4b5563;
}

/* Advertisement areas */
.ad-container {
    margin: 2rem 0;
    padding: 1rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    text-align: center;
}

.ad-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Responsive design */
@media (max-width: 640px) {
    .category-grid {
        grid-template-columns: 1fr;
    }

    .quiz-card {
        margin: 1rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}