:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #22c55e;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Background Blobs */
.blob-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    animation: drift 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: #ec4899;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes drift {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(100px, 100px) scale(1.2);
    }
}

.app {
    width: 90%;
    max-width: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.screen.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
}

/* Setup */
/* Setup */
.login-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.input-group input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
}

.setup-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.setup-group h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--text-main);
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.topic-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-weight: 600;
}

.topic-card:hover {
    background: var(--glass-border);
    transform: translateY(-5px);
    border-color: var(--primary);
}

.topic-card.selected {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.topic-card.done {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--success);
    cursor: default;
    pointer-events: none;
    opacity: 0.7;
}

.topic-card.done::after {
    content: ' ✓';
    color: var(--success);
}

.timer-options {
    display: flex;
    gap: 15px;
}

.timer-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.timer-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.main-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    width: 100%;
}

.main-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

/* Quiz Header */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.badge {
    background: var(--primary);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
}

.timer {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: monospace;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 8px 16px;
    border-radius: 12px;
}

.timer.warning {
    color: var(--danger);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Quiz Content */
.quiz-container {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 15px;
    margin-bottom: 30px;
}

.quiz-container::-webkit-scrollbar {
    width: 6px;
}

.quiz-container::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.question {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.02);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.question h3 {
    margin-bottom: 20px;
    line-height: 1.5;
}

.option {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px 20px;
    margin-bottom: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.option input[type="radio"] {
    margin-right: 15px;
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

.option:has(input:checked) {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

/* Result Screen */
.result-card {
    text-align: center;
    padding: 40px 0;
}

.score-circle {
    width: 200px;
    height: 200px;
    border: 8px solid var(--primary);
    border-radius: 50%;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.2);
}

.score-circle span {
    font-size: 3.5rem;
    font-weight: 700;
}

.score-circle small {
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}

#result-message {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: var(--text-muted);
}

/* Review Mode & Feedback Styles */
.option.correct {
    background: rgba(34, 197, 94, 0.2) !important;
    border-color: #22c55e !important;
}

.option.incorrect {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
}

.option.correct::after {
    content: ' ✓';
    color: #22c55e;
    font-weight: bold;
    margin-left: auto;
    font-size: 1.2rem;
}

.option.incorrect::after {
    content: ' ✗';
    color: #ef4444;
    font-weight: bold;
    margin-left: auto;
    font-size: 1.2rem;
}

.option.reveal-correct {
    border: 2px dashed #22c55e;
    background: rgba(34, 197, 94, 0.05);
}

.quiz-container.review-mode .option {
    cursor: default;
    pointer-events: none;
}

.review-info {
    font-size: 0.85rem;
    margin-top: 8px;
    font-weight: 600;
}

.review-info.correct-text {
    color: #22c55e;
}

.review-info.incorrect-text {
    color: #ef4444;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}