/* ==========================================================================
   CSS RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #fef7ff 0%, #e0e7ff 50%, #dbeafe 100%);
    min-height: 100vh;
    padding: 1rem;
    text-align: center;
    line-height: 1.6;
    color: #1e1b4b;
}

li {
    list-style: none;
}

/* ==========================================================================
   QUIZ CONTAINER
   ========================================================================== */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 2.5rem;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out;
}

.quiz-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #ec4899, #10b981);
    border-radius: 24px 24px 0 0;
}

.quiz-container h1 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    background: linear-gradient(135deg, #6366f1, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   PROGRESS & TIMER
   ========================================================================== */
.progress-bar {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-bottom: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #10b981, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timer-container {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    display: block;
}

.timer-circle-bg {
    fill: none;
    stroke: rgba(226, 232, 240, 0.6);
    stroke-width: 4;
    stroke-linecap: round;
}

.timer-circle {
    fill: none;
    stroke: url(#timerGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(14px, 4vw, 16px);
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

/* ==========================================================================
   QUESTION & OPTIONS
   ========================================================================== */
.question {
    /*font-size: clamp(1rem, 3vw, 1.3rem);*/
    font-size:18px;
    margin-bottom: 2rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: justify;
    text-align: center;
}

.options {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.options button {
    padding: 0.7rem 1.5rem;
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    border: 2px solid transparent;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    color: #475569;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    animation-delay: calc(0.1s * var(--i, 0));
}

.options button:nth-child(1) { --i: 1; }
.options button:nth-child(2) { --i: 2; }
.options button:nth-child(3) { --i: 3; }
.options button:nth-child(4) { --i: 4; }

.options button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.options button:hover::before {
    left: 100%;
}

.options button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
    border-color: #c7d2fe;
}

.options button.correct {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    border-color: #059669;
}

.options button.wrong {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
    border-color: #dc2626;
}

/* ==========================================================================
   ANSWER & NAVIGATION
   ========================================================================== */
.answer-text {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
    padding: 1rem;
    border-radius: 12px;
    border-left: 4px solid #10b981;
    text-align: left;
}

.navigation {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.navigation button {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.navigation button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

.score {
    font-size: clamp(1.1rem, 4vw, 2rem);
    margin-top: 1rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.reset-button {
    background: linear-gradient(135deg, #ec4899, #f472b6);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    margin-top: 2rem;
    border-radius: 16px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
    display: inline-block;
}

.reset-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.6);
}

.explanation {
    margin: 2rem 0;
    color: #1e293b;
    text-align: justify;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(236, 72, 153, 0.05));
    padding: 1.8rem;
    border-radius: 16px;
    border-left: 5px solid #6366f1;
    font-weight: 500;
    line-height: 1.7;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   SCORE CARD
   ========================================================================== */
.score-card {
    position: relative;
    max-width: 420px;
    width: 100%;
    margin: 2rem auto;
    padding: 2.5rem 2rem;
    background: linear-gradient(145deg, #1e1b4b 0%, #3730a3 50%, #312e81 100%);
    border-radius: 28px;
    box-shadow: 
        0 35px 80px -20px rgba(30, 27, 75, 0.6),
        0 20px 40px -10px rgba(62, 48, 163, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    color: #ffffff;
    text-align: center;
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.320, 1);
    font-family: 'Noto Sans Devanagari', 'Inter', -apple-system, sans-serif;
    animation: cardAppear 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.score-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(236, 72, 153, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.2) 0%, transparent 50%);
    z-index: 0;
    animation: shimmer 6s ease-in-out infinite;
}

.score-card > * {
    position: relative;
    z-index: 2;
}

.score-card h2 {
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #ec4899 0%, #f472b6 50%, #fb7185 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
    line-height: 1.2;
}

.score-card p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin: 1.2rem 0;
    padding: 1.2rem 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-weight: 600;
    letter-spacing: 0.5px;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.score-card p:nth-child(2) { animation-delay: 0.1s; }
.score-card p:nth-child(3) { animation-delay: 0.2s; }
.score-card p:nth-child(4) { animation-delay: 0.3s; }

.score-card p::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    border-radius: 0 4px 4px 0;
}

.score-card p:hover {
    transform: translateX(8px) scale(1.02);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.score-card p:nth-child(2)::before { background: linear-gradient(180deg, #10b981, #059669); }
.score-card p:nth-child(2) { color: #dcfce7; }
.score-card p:nth-child(3)::before { background: linear-gradient(180deg, #ef4444, #dc2626); }
.score-card p:nth-child(3) { color: #fecaca; }
.score-card p:nth-child(4)::before { background: linear-gradient(180deg, #6366f1, #4f46e5); }
.score-card p:nth-child(4) { color: #c7d2fe; }

.score-value {
    font-size: 1.4em;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.corner-decoration {
    position: absolute;
    border-radius: 50%;
    filter: blur(25px);
    opacity: 0.6;
    z-index: 1;
}

.corner-1 {
    width: 100px;
    height: 100px;
    top: -40px;
    left: -40px;
    background: linear-gradient(45deg, rgba(236, 72, 153, 0.6), rgba(99, 102, 241, 0.4));
    animation: float 6s ease-in-out infinite;
}

.corner-2 {
    width: 80px;
    height: 80px;
    bottom: -30px;
    right: -30px;
    background: linear-gradient(45deg, rgba(16, 185, 129, 0.6), rgba(236, 72, 153, 0.4));
    animation: float 8s ease-in-out infinite reverse;
}

.score-card:hover {
    transform: translateY(-12px) rotateX(2deg) rotateY(2deg);
    box-shadow: 
        0 50px 100px -25px rgba(30, 27, 75, 0.7),
        0 30px 60px -15px rgba(62, 48, 163, 0.5);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95) rotateX(-10deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0);
    }
}

@keyframes shimmer {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(180deg); }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    body { padding: 0.5rem; }
    
    .quiz-container {
        padding: 2rem 1.5rem;
        margin: 1rem 0;
        border-radius: 20px;
    }
    
    .options { grid-template-columns: 1fr; }
    .navigation { flex-direction: column; }
    .navigation button {
        width: 100%;
        max-width: 250px;
        margin: 4px auto;
        
    }
     
    .score-card {
        margin: 1.5rem 1rem;
        padding: 2rem 1.5rem;
        border-radius: 24px;
    }
    .corner-1 { width: 70px; height: 70px; top: -25px; left: -25px; }
    .corner-2 { width: 60px; height: 60px; bottom: -20px; right: -20px; }
}

@media (max-width: 480px) {
    .quiz-container {
        width: 90%;
        padding: 1.5rem 1rem;
        margin: 0.5rem auto;
        border-radius: 16px;
    }
    
    .explanation { padding: 1.2rem 1rem; margin: 1.5rem 0; }
    
    .score-card {
        margin: 1rem 0.5rem;
        padding: 1.8rem 1.2rem;
        border-radius: 20px;
    }
    .score-card h2 { margin-bottom: 1.5rem; }
    .score-card p { padding: 1rem 1.2rem; margin: 1rem 0; }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */
.score-card:focus-within {
    outline: 3px solid rgba(99, 102, 241, 0.5);
    outline-offset: 4px;
}