/* Matheezee Pro Exam Interface Styles
   Color Scheme:
   - Primary Blue: #dbeafe (bg), #1e40af (text), #93c5fd (border)
   - Amber/Warning: #fef3c7 (bg), #92400e (text), #fcd34d (border)
   - Purple: #ede9fe (bg), #5b21b6 (text)
   - Green/Success: #d1fae5 (bg), #065f46 (text), #6ee7b7 (border)
   - Red/Error: #fee2e2 (bg), #991b1b (text), #fca5a5 (border)
*/

/** {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
*/
body {
    font-family: 'Inter', sans-serif;
    background: #dbeafe;
    min-height: 100vh;
}

/* ========================================
   START SCREEN
======================================== */
.mz-start-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.mz-start-card {
    background: white;
    border-radius: 32px;
    padding: 50px 60px;
    max-width: 550px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: fadeInUp 0.6s ease;
    border: 1px solid #93c5fd;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.mz-start-card h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 20px;
}

.mz-start-card i {
    color: #1e40af;
}

.mz-exam-meta {
    background: #dbeafe;
    border-radius: 20px;
    padding: 20px;
    margin: 25px 0;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    border: 1px solid #93c5fd;
}

.mz-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #1e40af;
}

.mz-meta-item i {
    font-size: 20px;
    color: #1e40af;
}

.mz-start-btn {
    background: #1e40af;
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.mz-start-btn:hover {
    background: #1e3a8a;
    transform: translateY(-2px);
}

/* ========================================
   INSTRUCTION POPUP
======================================== */
.mz-instruction-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.mz-instruction-card {
    background: white;
    border-radius: 28px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 35px;
    animation: modalPop 0.3s ease;
    border: 1px solid #93c5fd;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.mz-instruction-card h2 {
    font-size: 26px;
    margin-bottom: 20px;
    color: #1e40af;
    border-left: 4px solid #1e40af;
    padding-left: 15px;
}

.mz-instruction-list {
    list-style: none;
    margin: 20px 0;
}

.mz-instruction-list li {
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #93c5fd;
    color: #1e40af;
}

.mz-instruction-list li i {
    width: 24px;
    color: #1e40af;
}

.mz-palette-guide {
    background: #dbeafe;
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #93c5fd;
}

.mz-palette-guide h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #1e40af;
}

.mz-guide-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.mz-guide-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e40af;
}

.mz-guide-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.mz-guide-color.not-visited { background: #cbd5e1; }
.mz-guide-color.not-answered { background: #ef4444; }
.mz-guide-color.answered { background: #10b981; }
.mz-guide-color.review { background: #f59e0b; }

.mz-instruction-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.palette-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mz-agree-btn:hover {
    background: #047857;
}

.mz-cancel-btn {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
}

.mz-cancel-btn:hover {
    background: #fecaca;
}

/* ========================================
   EXAM BODY
======================================== */
.mz-exam-wrapper {
    display: none;
    background: #dbeafe;
    min-height: 100vh;
}

/* TOP BAR */
.mz-top-bar {
    background: white;
    padding: 15px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 2px solid #93c5fd;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mz-subjects-area {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mz-subject-btn {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mz-subject-btn.active,
.mz-subject-btn:hover {
    background: #1e40af;
    color: white;
    border-color: #1e40af;
}

.mz-sections-area {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mz-section-btn {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ede9fe;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mz-section-btn.active,
.mz-section-btn:hover {
    background: #5b21b6;
    color: white;
}

.mz-timer-area {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    padding: 8px 20px;
    border-radius: 40px;
    color: white;
    font-weight: 700;
    font-size: 18px;
    font-family: monospace;
}

.mz-timer-area i {
    margin-right: 8px;
    color: #fcd34d;
}

/* MAIN LAYOUT - LEFT QUESTION | RIGHT PALETTE */
.mz-main-layout {
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

/* LEFT SIDE - QUESTION AREA */
.mz-question-area {
    background: white;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.mz-question-header {
    background: #dbeafe;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #93c5fd;
    flex-wrap: wrap;
    gap: 10px;
}

.mz-q-badge {
    background: #1e40af;
    color: white;
    padding: 6px 16px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
}

.mz-review-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #fcd34d;
}

.mz-question-text {
    padding: 28px;
    font-size: 17px;
    line-height: 1.7;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    background: #fafcff;
}

.mz-options-area {
    padding: 24px;
}

.mz-option {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 16px;
    margin-bottom: 10px;
    background: #f8fafc;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.mz-option:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.mz-option input {
    margin-top: 2px;
    accent-color: #1e40af;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.mz-option-text {
    flex: 1;
    font-size: 15px;
    color: #334155;
    line-height: 1.5;
}

.mz-numerical-input {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 16px;
    transition: all 0.2s;
}

.mz-numerical-input:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* BOTTOM BUTTONS */
.mz-bottom-buttons {
    padding: 20px 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.mz-nav-btn {
    background: white;
    border: 1px solid #cbd5e1;
    padding: 10px 22px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.mz-nav-btn:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.mz-save-next {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

.mz-save-next:hover {
    background: #a7f3d0;
}

.mz-review-btn {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.mz-review-btn:hover {
    background: #fde68a;
}

.mz-clear-btn {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.mz-clear-btn:hover {
    background: #fecaca;
}

.mz-submit-btn {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

.mz-submit-btn:hover {
    background: #b91c1c;
}

/* NAVIGATION ARROWS */
.mz-nav-arrows {
    padding: 0 24px 24px 24px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.mz-arrow-btn {
    background: #ede9fe;
    border: none;
    padding: 10px 28px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #5b21b6;
    transition: all 0.2s;
}

.mz-arrow-btn:hover {
    background: #5b21b6;
    color: white;
}

/* ========================================
   RIGHT SIDE - QUESTION PALETTE
   FIXED GRID - NO OVERLAPPING
======================================== */
.mz-palette-area {
    background: white;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 20px;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.mz-palette-area h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #1e40af;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid #93c5fd;
}

.mz-palette-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.mz-palette-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #475569;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.green { background: #10b981; }
.legend-dot.yellow { background: #f59e0b; }
.legend-dot.grey { background: #cbd5e1; }
.legend-dot.red { background: #ef4444; }

.mz-palette-subject {
    margin-bottom: 20px;
}

.mz-palette-subject-title {
    font-weight: 700;
    font-size: 13px;
    padding: 6px 10px;
    background: #dbeafe;
    border-radius: 8px;
    margin-bottom: 12px;
    color: #1e40af;
}

/* ========== IMPORTANT: PALETTE GRID FIX ========== */
.mz-palette-grid {
display:grid;
grid-template-columns:repeat(10,18px);
gap:8px;
margin-bottom:2px;
}


/* QUESTION BUTTON */

.palette-btn{
width:25px;
height:25px;
border-radius:50%;
border:none;
background:#d1d5db;
font-size:12px;
display:flex;
align-items:center;
justify-content:center;
cursor:pointer;
padding: 1px;
box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}


.palette-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Palette button states */
.palette-btn.answered {
    background: #10b981;
    color: white;
}

.palette-btn.review {
    background: #f59e0b;
    color: white;
}

.palette-btn.not-answered {
    background: #ef4444;
    color: white;
}

.palette-btn.not-visited {
    background: #cbd5e1;
    color: #475569;
}

.palette-btn.current {
    border: 3px solid #1e40af;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px white, 0 0 0 4px #1e40af;
}

/* ========================================
   SUBMIT POPUP
======================================== */
.mz-submit-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.mz-submit-card {
    background: white;
    border-radius: 28px;
    padding: 35px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid #93c5fd;
}

.mz-submit-card h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #1e40af;
}

.mz-submit-stats {
    background: #dbeafe;
    padding: 15px;
    border-radius: 16px;
    margin: 20px 0;
    color: #1e40af;
}

.mz-submit-stats p {
    margin: 8px 0;
}

.mz-submit-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 900px) {
    .mz-main-layout {
        grid-template-columns: 1fr;
    }
    
    .mz-palette-area {
        position: static;
        margin-top: 20px;
    }
    
    .mz-top-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mz-subjects-area,
    .mz-sections-area {
        justify-content: center;
    }
    
    .mz-timer-area {
        text-align: center;
        justify-content: center;
    }
    
    .mz-palette-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 600px) {
    .mz-palette-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .mz-bottom-buttons {
        justify-content: center;
    }
    
    .mz-question-header {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   LaTeX RENDERING
======================================== */
.MJX-TEX {
    font-size: 1.1em;
}

.mz-question-text .MathJax {
    overflow-x: auto;
    overflow-y: hidden;
}
   /*-------css end --------
/* DASHBOARD TABLE */

.mz-dashboard {
    max-width: 900px;
    margin: 40px auto;
}

.mz-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.mz-table th {
    background: #2563eb;
    color: white;
    padding: 12px;
    text-align: left;
}

.mz-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.mz-table tr:hover {
    background: #f8fafc;
}
/* DASHBOARD HERO */

/* DASHBOARD HERO */

.mz-dashboard-hero {
    position: relative;
    height: 240px;
    border-radius: 16px;
    margin-bottom: 40px;
    background-repeat: no-repeat;
    background-position: right bottom;
    background-size: 150px;   /* control image size here */
    background-color: #2563eb;
    overflow: hidden;
}

.mz-dashboard-overlay {
    position: absolute;
    inset: 0;
    padding: 40px;
    background: linear-gradient(
        90deg,
        rgba(37,99,235,0.95) 45%,
        rgba(37,99,235,0.6) 75%,
        rgba(37,99,235,0.2) 100%
    );
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mz-dashboard-overlay h2 {
    font-size: 28px;
    margin: 0;
}

.mz-dashboard-overlay p {
    margin-top: 8px;
    font-size: 15px;
}

/*============== MATHEEZEE ADMIN STYLING================== */

.wrap.mz-admin {
    background: #f8fafc;
    padding: 30px;
}

.wrap.mz-admin h2 {
    text-align: center;
    font-weight: 800;
    padding: 15px;
    border-radius: 10px;
    background: linear-gradient(90deg, #e0f2fe, #bae6fd);
    color: #0c4a6e;
    margin-bottom: 30px;
}

.mz-admin .form-table {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    padding: 20px;
}

.mz-admin .form-table th {
    width: 200px;
    padding: 15px 10px;
    font-weight: 600;
    color: #334155;
}

.mz-admin .form-table td {
    padding: 15px 10px;
}

.mz-admin input,
.mz-admin select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
}

.mz-admin input:focus,
.mz-admin select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56,189,248,0.2);
    outline: none;
}

.mz-advanced-box {
    margin-top: 25px;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}

.mz-section-card {
    background: #f1f5f9;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.button-primary {
    background: linear-gradient(90deg, #38bdf8, #0ea5e9) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
}

.button-primary:hover {
    background: linear-gradient(90deg, #0ea5e9, #0284c7) !important;
}
.mz-numerical-input{
width:120px;
padding:8px;
font-size:16px;
border:1px solid #ccc;
border-radius:6px;
}
/*extre added*/
.mz-right{
min-width:220px;
}

.mz-section-btn{
position:relative;
z-index:5;
}

/* ===============================
MOBILE EXAM LAYOUT FIX
================================ */

/* ===============================
   COMPLETE MOBILE EXAM LAYOUT FIX - REPLACE EXISTING MOBILE SECTION
================================ */

@media (max-width: 768px) {
    
    /* Main layout stack */
    .mz-main-layout {
        display: flex !important;
        flex-direction: column !important;
        padding: 10px !important;
        gap: 15px !important;
    }
    
    /* Question area full width */
    .mz-question-area {
        width: 100% !important;
        margin-bottom: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Scrollable content */
    .mz-question-scrollable {
        flex: 1;
        overflow-y: auto;
        max-height: 50vh;
    }
    
    /* Fixed bottom buttons - VISIBLE */
    .mz-bottom-buttons-fixed {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 12px !important;
        background: white !important;
        border-top: 2px solid #93c5fd !important;
        position: sticky !important;
        bottom: 0 !important;
        z-index: 100 !important;
    }
    
    /* Fixed nav arrows */
    .mz-nav-arrows-fixed {
        display: flex !important;
        justify-content: center !important;
        gap: 12px !important;
        padding: 10px !important;
        background: white !important;
        border-top: 1px solid #e2e8f0 !important;
        position: sticky !important;
        bottom: 0 !important;
        z-index: 99 !important;
    }
    
    /* Button styling for mobile */
    .mz-nav-btn {
        padding: 8px 14px !important;
        font-size: 12px !important;
        flex: 0 1 auto !important;
    }
    
    .mz-arrow-btn {
        padding: 6px 16px !important;
        font-size: 12px !important;
    }
    
    /* Palette area below question */
    .mz-palette-area {
        width: 100% !important;
        margin-top: 10px !important;
        position: static !important;
        max-height: 35vh !important;
    }
    
    /* Top bar stacking */
    .mz-top-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 10px !important;
    }
    
    .mz-subjects-area,
    .mz-sections-area {
        justify-content: center !important;
    }
    
    .mz-subject-btn,
    .mz-section-btn {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    
    .mz-timer-area {
        text-align: center !important;
        align-self: center !important;
        margin-top: 5px !important;
        font-size: 16px !important;
    }
    
    /* Question header */
    .mz-question-header {
        flex-direction: column !important;
        text-align: center !important;
        padding: 12px !important;
    }
    
    /* Question text */
    .mz-question-text {
        padding: 15px !important;
        font-size: 14px !important;
    }
    
    /* Options */
    .mz-options-area {
        padding: 15px !important;
    }
    
    .mz-option {
        padding: 10px 12px !important;
        margin-bottom: 8px !important;
    }
    
    .mz-option-text {
        font-size: 13px !important;
    }
    
    /* Palette grid */
    .mz-palette-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 6px !important;
    }
    
    .palette-btn {
        width: 100% !important;
        min-width: 30px !important;
        height: 32px !important;
        font-size: 11px !important;
    }
}