/* styles.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary: #285e01;       
    --secondary: #dc2626;     
    --accent: #076718;        
    --dark: #1e293b;          
    --light: #f8fafc;         
    --success: #059669;       
    --danger: #dc2626;        
    --glass: rgba(248, 250, 252, 0.85);
    --glass-border: rgba(37, 99, 235, 0.3);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(-45deg, #182900, #1c9105, #15481a, #27562b);
    background-size: 400% 400%;
    background-attachment: fixed; 
    animation: gradientBG 15s ease infinite;
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    width: 100%;
    max-width: 850px;
    margin: 2rem 1rem;
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
    position: relative;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Header */
header {
    text-align: center;
    padding: 2rem;
    background: rgba(37, 99, 235, 0.1);
    border-bottom: 1px solid rgba(37, 99, 235, 0.1);
}

h1 { font-weight: 700; color: var(--primary); font-size: 2.2rem; margin-bottom: 0.5rem; }
h2 { color: var(--dark); margin-bottom: 1rem; }
p { color: #666; }

.quiz-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    font-weight: 600;
    background: rgba(37, 99, 235, 0.1);
}

.header-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.header-home-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    border-color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Controls */
.control-panel {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.number-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 0.5rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

input[type="number"] {
    width: 80px;
    text-align: center;
    border: 2px solid #ddd;
    background: white;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    font-family: 'Poppins', sans-serif;
    margin: 0 10px;
    -moz-appearance: textfield;
}
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type="number"]:focus { outline: none; border-color: var(--primary); }

.circle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.circle-btn:hover { transform: scale(1.1); }

.btn {
    padding: 0.8rem 2rem;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn-primary {
    background: linear-gradient(to right, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4); }
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }

/* Quiz Progress & Question */
.progress-container { height: 6px; background: #eee; width: 100%; }
.progress-bar { height: 100%; background: var(--secondary); width: 0%; transition: width 0.4s ease; }

.question-card {
    padding: 2rem;
    touch-action: pan-y;
    padding-bottom: 6rem;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--dark);
    line-height: 1.4;
}

.options-grid { display: grid; gap: 0.75rem; }
.option {
    padding: 1rem 1.25rem;
    background: white;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-weight: 500;
    min-height: 60px;
}
.option:hover { border-color: var(--primary); background: #e8f5e8; }
.option.selected {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}
.option-badge {
    background: rgba(0,0,0,0.1);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 12px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.nav-buttons-container {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #eee;
    background: var(--glass);
    position: sticky;
    bottom: 0;
    z-index: 10;
    width: 100%;
}

/* Results */
.results-dashboard { padding: 2rem; text-align: center; }
.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--success) var(--percent, 0%), #eee 0);
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.score-circle::before {
    content: '';
    position: absolute;
    width: 130px;
    height: 130px;
    background: white;
    border-radius: 50%;
}
.score-text { position: relative; z-index: 1; font-size: 2.5rem; font-weight: 700; color: var(--dark); }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: white; padding: 1rem; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-label { font-size: 0.9rem; color: #666; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* Review */
.review-item {
    background: white;
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
    border-left: 5px solid #ccc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.review-item.correct { border-left-color: var(--success); }
.review-item.incorrect { border-left-color: var(--danger); }
.review-item.skipped { border-left-color: #f1c40f; }
.review-header { padding: 1rem; background: #f8f9fa; display: flex; justify-content: space-between; font-weight: 600; }
.review-body { padding: 1rem; }
.ans-row { display: flex; justify-content: space-between; margin-top: 0.5rem; padding: 0.5rem; border-radius: 6px; font-size: 0.95rem; }
.ans-row.your-ans { background: #fff0f0; color: var(--danger); }
.ans-row.your-ans.correct { background: #e6fffa; color: var(--success); }
.ans-row.correct-ans { background: #e6fffa; color: var(--success); font-weight: 600; }

@media (max-width: 600px) {
    .container { margin: 0; border-radius: 0; min-height: 100vh; border: none; max-width: 100%; }
    header { padding: 1.2rem 0.5rem; }
    h1 { font-size: 1.5rem; line-height: 1.2; margin-bottom: 0.25rem; }
    header p { font-size: 0.85rem; line-height: 1.3; }
    .quiz-header-info { padding: 0.8rem 1rem; font-size: 0.9rem; }
    .header-home-btn { width: 32px; height: 32px; font-size: 1rem; }
    .question-card { padding: 1.2rem 1rem; padding-bottom: 5.5rem; }
    .question-text { font-size: 1.1rem; margin-bottom: 1.2rem; line-height: 1.35; }
    .options-grid { gap: 0.6rem; }
    .option { padding: 0.8rem 1rem; min-height: 52px; font-size: 0.95rem; }
    .option-badge { width: 26px; height: 26px; font-size: 0.85rem; margin-right: 10px; }
    .nav-buttons-container { padding: 0.8rem 1rem; position: fixed; bottom: 0; left: 0; right: 0; background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid rgba(37, 99, 235, 0.1); box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); }
    .btn { padding: 0.7rem 1.2rem; font-size: 0.9rem; min-width: 100px; }
    #subjectTag { font-size: 0.75rem; padding: 2px 6px; margin-top: 2px; }
    .question-card > div:first-child { font-size: 0.85rem; margin-bottom: 1rem; }
    .stats-grid { grid-template-columns: 1fr; gap: 0.8rem; }
    .stat-card { padding: 0.8rem; }
    .stat-value { font-size: 1.3rem; }
    .score-circle { width: 120px; height: 120px; margin-bottom: 1.5rem; }
    .score-circle::before { width: 100px; height: 100px; }
    .score-text { font-size: 2rem; }
}

.screen { display: none; animation: fadeIn 0.4s ease; position: relative; min-height: calc(100vh - 100px); }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }