:root { --bg: #f4f7f6; --surface: #ffffff; --primary: #2c3e50; --accent: #3498db; --success: #27ae60; --warning: #f39c12; --danger: #e74c3c; --border: #e0e0e0; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: 'Noto Sans Assamese', 'Noto Sans', system-ui, -apple-system, sans-serif; 
    background: var(--bg); color: #333; line-height: 1.6; 
}
/* Layout */
.exam-header { background: var(--primary); color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; }
.timer { font-size: 1.2rem; font-weight: bold; font-variant-numeric: tabular-nums; }
.sync-status { text-align: center; font-size: 0.8rem; padding: 5px; color: var(--success); font-weight: bold; background: #fff; border-bottom: 1px solid var(--border); }
.exam-container { display: flex; max-width: 1200px; margin: 20px auto; gap: 20px; padding: 0 15px; position: relative; }
.question-area { flex: 1; background: var(--surface); border-radius: 8px; padding: 25px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.palette-drawer { width: 300px; background: var(--surface); border-radius: 8px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

/* Elements */
.q-content { font-size: 1.1rem; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.option-row { display: flex; align-items: center; padding: 15px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; transition: 0.2s; }
.option-row:hover { border-color: var(--accent); }
.option-row.selected { border-color: var(--accent); background: rgba(52, 152, 219, 0.05); }
.option-row input { margin-right: 15px; transform: scale(1.2); }
.option-row label { flex: 1; cursor: pointer; }

/* Buttons */
button { padding: 10px 15px; border: none; border-radius: 5px; font-weight: bold; cursor: pointer; font-size: 1rem; }
.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: #ecf0f1; color: var(--primary); }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.full-width { width: 100%; }
.action-bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* Palette */
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; margin-top: 15px; }
.pal-btn { width: 40px; height: 40px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; padding: 0; color: white; }
.pal-btn.unans { background: #bdc3c7; color: #333; }
.pal-btn.ans { background: var(--success); }
.pal-btn.rev { background: var(--warning); }
.pal-btn.current { box-shadow: 0 0 0 3px var(--accent); }
.legend { display: flex; gap: 10px; font-size: 0.8rem; margin-top: 10px; flex-wrap: wrap; }
.badge { padding: 3px 8px; border-radius: 3px; color: white; }
.badge.unans { background: #bdc3c7; color: #333;}
.badge.ans { background: var(--success); }
.badge.rev { background: var(--warning); }

/* Add these styles to your existing style.css */

/* BUG 6 FIX: Lightweight UX Friction against accidental/casual copying */
.exam-body {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* Allow text selection in specific inputs if needed later, though not in this phase */
input[type="text"] {
    user-select: text;
}

/* BUG 4 FIX: Answered + Marked distinct visual state (Deep Purple/Blue) */
.pal-btn.ans-rev { 
    background: #8e44ad; 
    color: white; 
}
.badge.ans-rev { 
    background: #8e44ad; 
    color: white; 
}

/* Append to existing CSS */

/* Dashboard Styles */
.dashboard-wrapper {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 55px; /* Sits right under header */
    z-index: 90;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    padding: 10px 15px;
    flex-wrap: wrap;
    gap: 10px;
}
.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.85rem;
    padding: 5px 15px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid var(--border);
    min-width: 80px;
}
.stat-label { color: #7f8c8d; font-weight: 600; text-transform: uppercase; font-size: 0.75rem; margin-bottom: 2px;}
.stat-val { font-size: 1.1rem; font-weight: bold; color: var(--primary); }

/* Highlight Dashboard Badges */
.stat-box.ans-box .stat-val { color: var(--success); }
.stat-box.pend-box .stat-val { color: #7f8c8d; }
.stat-box.rev-box .stat-val { color: var(--warning); }
.stat-box.ans-rev-box .stat-val { color: #8e44ad; }

/* Move Sync Status inside Dashboard for better mobile spacing */
.sync-status {
    text-align: center; font-size: 0.8rem; padding: 4px; color: var(--success); font-weight: bold; background: #fff; 
}

/* Update Font Family for Multi-language (Assamese & Hindi) */
body { 
    font-family: 'Noto Sans Assamese', 'Noto Sans', system-ui, -apple-system, sans-serif; 
    background: var(--bg); color: #333; line-height: 1.6; 
}

/* Header Adjustments */
.header-controls { display: flex; align-items: center; gap: 15px; }
#lang-selector { padding: 5px 10px; border-radius: 4px; border: 1px solid #ccc; font-size: 0.9rem; }

/* Dual Clock Bar */
.clock-bar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.clock-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 20px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid var(--border);
    transition: 0.3s;
}
.clock-box.warning { background: #fdf2e9; border-color: #f39c12; color: #d35400; }
.clock-box.critical { background: #fae5e5; border-color: #e74c3c; color: #c0392b; animation: pulse 1s infinite; }
.clock-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: #7f8c8d; }
.clock-val { font-size: 1.3rem; font-weight: bold; font-variant-numeric: tabular-nums; }
.clock-rem { color: var(--primary); }
.clock-box.warning .clock-rem { color: #d35400; }
.clock-box.critical .clock-rem { color: #c0392b; }

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.7; } 100% { opacity: 1; } }

/* Fix Dashboard / Palette grids to ensure proper spacing */
.palette-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr)); 
    gap: 8px; 
    margin-top: 15px; 
}
.pal-btn { width: 45px; height: 45px; font-weight: bold; }



/* Language Selector */
.lang-select { padding: 4px 8px; border-radius: 4px; border: none; font-size: 0.9rem; background: #fff; color: #333; cursor: pointer; }

/* Clocks */
.clock-compact { font-size: 0.9rem; display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.clock-compact span:first-child { font-size: 0.7rem; color: #bdc3c7; text-transform: uppercase; font-weight: 600; }
.time-val { font-size: 1.1rem; font-weight: bold; font-variant-numeric: tabular-nums; }
.text-danger { color: #e74c3c !important; animation: pulse 1.5s infinite; }
.text-danger span:first-child { color: #e74c3c !important; }

/* Palette Stats & Layout */
.compact-stats {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; font-size: 0.85rem; padding: 10px; background: #f8f9fa; border-radius: 6px; border: 1px solid var(--border);
}
.legend-item { display: flex; align-items: center; gap: 5px; width: 45%; }
.legend-item .badge { display: inline-block; width: 12px; height: 12px; border-radius: 2px; padding: 0; }

.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.pal-btn { width: 40px; height: 40px; font-weight: bold; border-radius: 4px; padding: 0;}

/* Post Submit Card */
.post-submit-card { background:#fff; padding:40px; border-radius:8px; box-shadow:0 0 20px rgba(0,0,0,0.1); width:100%; max-width:450px; text-align: center; }
.status-box { display: inline-block; margin-top: 15px; padding: 10px 20px; background: #f8f9fa; border: 1px solid var(--border); border-radius: 4px; font-size: 1.1rem;}



/* =========================================
   BUG 1 FIX: TOP NAVIGATION DESKTOP LAYOUT
   ========================================= */

 

/* =========================================
   BUG 1 FIX: TOP NAVIGATION DESKTOP
   ========================================= */
.exam-header-compact {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between; /* Pushes left and right groups apart */
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 25px; /* Proper spacing between elements */
}

/* Hide palette toggle button on desktop (>= 768px) */
#toggle-palette {
    display: none;
}

/* =========================================
   BUG 1 & 5 FIX: MOBILE HEADER & PALETTE
   ========================================= */
@media (max-width: 768px) {
    .exam-header-compact {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 15px;
        gap: 15px;
    }
    
    .header-left, .header-right {
        justify-content: space-between;
        width: 100%;
        gap: 10px;
    }

    /* Show palette button on mobile */
    #toggle-palette { 
        display: block; 
        padding: 6px 12px;
    }
    
    /* Missing Mobile Palette CSS that caused the bug */
    .palette-drawer {
        display: none; /* Hidden by default */
        position: fixed;
         
        right: 0; 
        bottom: 0;
        width: 85%;
        max-width: 350px;
        z-index: 99;
        overflow-y: auto;
        border-radius: 0;
        background: var(--surface);
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    }
    
    /* JS adds this class to open the drawer */
    .palette-drawer.open {
        display: block;
    }
}

/* =========================================
   BUG 6 FIX: PALETTE LEGEND SPACING
   ========================================= */
.compact-stats {
    display: flex; 
    flex-wrap: wrap; 
    justify-content: space-between; /* Forces 2-column gap */
    row-gap: 12px; 
    margin-bottom: 15px; 
    padding: 12px; 
    background: #f8f9fa; 
    border-radius: 6px; 
    border: 1px solid var(--border);
}

.legend-item { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    width: 48%; /* Exactly two columns */
    font-size: 0.85rem;
}

/* Force "Total" to span full width and center */
.compact-stats .legend-item:last-child {
    width: 100%;
    justify-content: center;
    border-top: 1px dashed #bdc3c7;
    margin-top: 5px;
    padding-top: 10px;
    font-weight: bold;
}

/* =========================================
   OPTIONAL BRANDING: HEADER LOGO
   ========================================= */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    /* Completely hide the logo on mobile to protect the compact grid layout */
    .header-logo {
        display: none;
    }
}

/* =========================================
   OPTIONAL BRANDING: EXAM WATERMARK
   ========================================= */
.question-area {
    position: relative; /* Anchor for the absolute watermark */
}

.question-area::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background-image: url('https://thediamondgroup.co.in/assets/images/my_image/logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.04; /* Extremely low opacity so it remains purely in the background */
    pointer-events: none; /* Guaranteed to let all mouse clicks pass through */
    z-index: 0;
}

/* Force all actual exam content to sit above the watermark layer */
.question-area > * {
    position: relative;
    z-index: 1;
}