/* styles.css - Accounting Theme */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary: #2E8B57;
    --secondary: #4682B4;
    --accent: #20B2AA;
    --dark: #1A3C34;
    --light: #F0FFF0;
    --success: #228B22;
    --danger: #B22222;
    --glass: rgba(240, 255, 240, 0.9);
    --glass-border: rgba(46, 139, 87, 0.3);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(45deg, #2E8B57, #4682B4, #20B2AA);
    background-size: 400% 400%;
    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);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Header --- */
header {
    text-align: center;
    padding: 2rem;
    background: rgba(46, 139, 87, 0.1);
    border-bottom: 1px solid rgba(46, 139, 87, 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; }

/* --- Inputs & Buttons --- */
.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 Box Fix */
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;
}

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;
}

.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), #3CB371);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 139, 87, 0.3);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(46, 139, 87, 0.4); }

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover { background: var(--primary); color: white; }

/* --- Quiz UI --- */
.quiz-header-info {
    display: flex;
    justify-content: space-between;
    padding: 1rem 2rem;
    font-weight: 600;
    background: rgba(46, 139, 87, 0.1);
}

.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; /* Allows vertical scroll but reserves horizontal swipe for our JS */
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--dark);
}

.options-grid {
    display: grid;
    gap: 1rem;
}

.option {
    padding: 1rem 1.5rem;
    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;
}

.option:hover { border-color: var(--primary); background: #e8f5e8; }

.option.selected {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(46, 139, 87, 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: 15px;
    font-size: 0.9rem;
}

/* --- Results Dashboard --- */
.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 Section --- */
.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; }

/* --- Floating Home Button --- */
.floating-home-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), #3CB371);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.floating-home-btn:hover {
    transform: scale(1.15) rotate(-10deg);
    background: linear-gradient(135deg, var(--secondary), #5F9EA0);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .container { 
        margin: 0; 
        border-radius: 0; 
        min-height: 100vh; 
        border: none; 
    }

    /* (a) FIX: Compact Header for Mobile 
       Reduces padding and font size so content isn't pushed down */
    header {
        padding: 1rem 0.5rem; 
    }
    
    h1 { 
        font-size: 1.5rem; /* Reduced from 1.8rem */
        line-height: 1.2;  /* Tighter line spacing */
        margin-bottom: 0.25rem;
    }
    
    header p {
        font-size: 0.85rem;
    }

    .stats-grid { 
        grid-template-columns: 1fr; 
    }
    
    /* (b) FIX: Floating Button Repositioning
       Moves the button UP (110px) so it floats ABOVE the Next/Submit buttons */
    .floating-home-btn {
        width: 50px;
        height: 50px;
        bottom: 110px; /* Raised to clear the navigation bar area */
        right: 20px;
        font-size: 1.5rem;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Slightly lighter shadow for mobile */
        opacity: 0.9;
    }
    
    /* Optional: Adjust quiz card padding for smaller screens */
    .question-card {
        padding: 1.5rem;
    }
}

.screen { display: none; animation: fadeIn 0.4s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }