/* Filter Section */
.hero-section {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    color: var(--dark-blue);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--pink), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section p {
    font-size: 1.1rem;
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}

.filter-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.filter-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--light-teal);
    margin-bottom: 1rem;
}

.filter-card label {
    display: block;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
}

.subject-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--light-teal);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Sora', sans-serif;
    background: var(--white);
    color: var(--dark-gray);
    cursor: pointer;
    transition: all 0.2s ease;
}

.subject-select:hover {
    border-color: var(--teal);
}

.subject-select:focus {
    outline: none;
    border-color: var(--dark-teal);
    box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.1);
}

.topic-filter {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--light-teal);
}

.topic-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--light-teal);
}

.topic-filter-header label {
    font-weight: 600;
    color: var(--dark-blue);
}

.toggle-all-btn {
    background: var(--light-teal);
    color: var(--dark-teal);
    border: 1px solid var(--teal);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-all-btn:hover {
    background: var(--teal);
    color: var(--white);
}

.topic-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.topic-checkbox {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.topic-checkbox:hover {
    background: var(--light-teal);
}

.topic-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: var(--teal);
}

.topic-checkbox span {
    color: var(--dark-gray);
    font-size: 0.95rem;
}

/* Quiz Container */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.quiz-header {
    margin-bottom: 2rem;
}

.question-counter {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--light-teal);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--teal), var(--pink));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.question-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--light-teal);
}

.question-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.topic-badge, .elo-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.topic-badge {
    background: var(--light-teal);
    color: var(--dark-teal);
    border: 1px solid var(--teal);
}

.elo-badge {
    background: var(--light-pink);
    color: var(--dark-pink);
    border: 1px solid var(--pink);
}

.question-content h3 {
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
    line-height: 1.4;
    font-size: 1.2rem;
}

.choices {
    margin: 1.5rem 0;
}

.choice-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem;
    margin: 0.75rem 0;
    border: 2px solid var(--white);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-size: 1rem;
}

.choice-btn:hover:not(:disabled) {
    border-color: var(--dark-teal);
    background: var(--light-teal);
    transform: translateY(-1px);
}

.choice-btn.selected {
    border-color: var(--dark-teal);
    background: var(--light-teal);
}

.choice-btn.correct {
    border-color: var(--green-teal);
    background: var(--light-green-teal);
}

.choice-btn.incorrect {
    border-color: var(--pink);
    background: var(--light-pink);
}

.choice-btn.disabled {
    opacity: 0.6;
    cursor: default;
}

.choice-btn:disabled {
    cursor: default;
}

.choice-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--white);
    color: var(--dark-gray);
    font-weight: bold;
    margin-right: 1rem;
    flex-shrink: 0;
}

.choice-btn.selected .choice-letter {
    background: var(--dark-teal);
    color: white;
}

.choice-btn.correct .choice-letter {
    background: var(--green-teal);
    color: white;
}

.choice-btn.incorrect .choice-letter {
    background: var(--pink);
    color: white;
}

.quiz-actions {
    margin: 2rem 0;
    text-align: center;
}

#submit-btn {
    background: var(--dark-teal);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#submit-btn:hover:not(:disabled) {
    background: var(--blue-teal);
    transform: translateY(-1px);
}

#submit-btn:disabled {
    background: var(--gray);
    cursor: not-allowed;
    transform: none;
}

.answer-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--white);
}

.answer-section.hidden {
    display: none;
}

.feedback {
    margin-bottom: 1.5rem;
    text-align: center;
}

.feedback-correct {
    color: var(--dark-green-teal);
    background: var(--light-teal);
    border: 2px solid var(--teal);
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
}

.feedback-incorrect {
    color: var(--dark-pink);
    background: var(--light-pink);
    border: 2px solid var(--pink);
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
}

.feedback-info {
    color: var(--dark-gray);
    background: var(--light-teal);
    border: 2px solid var(--teal);
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
}

.solution {
    background: var(--light-yellow);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid var(--yellow);
}

.solution h4 {
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.helpful-links {
    margin: 1.5rem 0;
}

.helpful-links h4 {
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.helpful-links ul {
    list-style: none;
    padding: 0;
}

.helpful-links li {
    margin: 0.5rem 0;
}

.helpful-links a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
}

.helpful-links a:hover {
    text-decoration: underline;
}

.next-actions {
    text-align: center;
    margin-top: 2rem;
}

.next-btn, .finish-btn, .restart-btn, .reload-btn {
    background: var(--green-teal);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin: 0 0.5rem;
    transition: all 0.2s ease;
}

.next-btn:hover, .finish-btn:hover {
    background: var(--dark-green-teal);
    transform: translateY(-1px);
}

.restart-btn {
    background: var(--green-teal);
    margin-bottom: 20px;
}

.restart-btn:hover {
    background: var(--dark-green-teal);
}

.reload-btn {
    background: var(--gray);
}

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

.quiz-complete {
    text-align: center;
    padding: 3rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.quiz-complete h2 {
    color: var(--green-teal);
    margin-bottom: 1rem;
}

.short-answer {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--green-teal);
    margin: 1rem 0;
}

.loading, .error-message, .no-questions {
    text-align: center;
    padding: 2rem;
    margin: 1rem 0;
    border-radius: 8px;
    background: var(--white);
    border: 1px solid var(--white);
}

.error-message {
    background: var(--light-pink);
    border-color: var(--pink);
    color: var(--dark-pink);
}

.error-message button {
    margin-top: 1rem;
    background: var(--pink);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.error-message button:hover {
    background: var(--dark-pink);
}

/* Responsive design */
@media (max-width: 768px) {
    .filter-section {
        padding: 0 0.5rem;
    }

    .topic-checkboxes {
        grid-template-columns: 1fr;
    }

    .topic-filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .toggle-all-btn {
        align-self: stretch;
    }

    .quiz-container {
        padding: 0.5rem;
    }
    
    .question-card {
        padding: 1.5rem;
    }
    
    .choice-btn {
        padding: 0.75rem;
    }
    
    .choice-letter {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.9rem;
    }
    
    .question-meta {
        gap: 0.25rem;
    }
}