/* ==========================================
   VARIABLES & THEME
   ========================================== */
:root {
    /* Dark Futuristic Theme (Default) */
    --bg-color: #0b0c14;
    --surface-color: rgba(22, 25, 43, 0.85);
    --primary-color: #00e5ff; 
    --primary-glow: rgba(0, 229, 255, 0.4);
    --secondary-color: #b400ff; /* Purple */
    --secondary-glow: rgba(180, 0, 255, 0.4);
    --accent-color: #ffd700; /* Gold */
    
    --success-color: #00ff88;
    
    --mcmi-text-main: #e0e6ed;
    --mcmi-text-muted: #8a9ba8;
    
    /* Glassmorphism Variables */
    --bg-panel: rgba(0, 0, 0, 0.3);
    --bg-panel-light: rgba(255, 255, 255, 0.02);
    --bg-panel-btn: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-border-strong: rgba(255, 255, 255, 0.1);
    --btn-hover-overlay: rgba(255, 255, 255, 0.1);
    
    --bg-gradient-1: rgba(0, 229, 255, 0.08);
    --bg-gradient-2: rgba(180, 0, 255, 0.08);
    --border-radius: 16px;
    --box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
/* Light Theme Overrides */
[data-theme="light"] {
    --bg-color: #f4f6f8;
    --surface-color: rgba(255, 255, 255, 0.85);
    --primary-color: #00a8bb;
    --primary-glow: rgba(0, 168, 187, 0.3);
    --secondary-color: #8e24aa; /* Darker purple */
    --secondary-glow: rgba(142, 36, 170, 0.3);
    --accent-color: #d4af37;
    
    --success-color: #00c853;
    
    --mcmi-text-main: #2c3e50;
    --mcmi-text-muted: #5c6a77;
    
    /* Glassmorphism Variables for Light Mode */
    --bg-panel: rgba(0, 0, 0, 0.04);
    --bg-panel-light: rgba(0, 0, 0, 0.02);
    --bg-panel-btn: rgba(0, 0, 0, 0.03);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-strong: rgba(0, 0, 0, 0.15);
    --btn-hover-overlay: rgba(0, 0, 0, 0.05);
    
    --bg-gradient-1: rgba(0, 168, 187, 0.08);
    --bg-gradient-2: rgba(142, 36, 170, 0.08);
    --box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* ==========================================
   RESET & BASE
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, var(--bg-gradient-1), transparent 25%),
        radial-gradient(circle at 85% 30%, var(--bg-gradient-2), transparent 25%);
    color: var(--mcmi-text-main);
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease, color 0.4s ease;
}
.hidden { display: none !important; }

.container {
    width: min(100%, 800px);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}
h1, h2, h3, h4 { color: var(--mcmi-text-main); font-weight: 700; margin-bottom: 1rem; }
.start-header h2 {
    font-size: clamp(1.1rem, 2.0vw, 1.2rem); 
    /* margin-top: 1.0rem;  */
}
.instructions h3 {font-size: clamp(1.0rem, 2.0vw, 1.2rem); margin-bottom: 10px; color: var(--mcmi-text-main);}
.instructions ul li { font-size: clamp(0.85rem, 1.7vw, 0.95rem); margin-bottom: 0.5rem; color: var(--mcmi-text-muted); }
p { margin-bottom: 1rem; color: var(--mcmi-text-muted); text-align: justify; line-height: 1.6;}
/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--btn-hover-overlay);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
    z-index: -1;
}
.btn:hover::before { transform: scaleX(1); }
.btn-primary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-color);
    color: #fff; /* Always white on hover for contrast */
    box-shadow: 0 0 20px var(--primary-glow);
}
.btn-secondary {
    background: transparent;
    color: var(--accent-magenta);
    border: 1px solid var(--accent-magenta);
}
.btn-outline {
    background: transparent;
    color: var(--mcmi-text-main);
    border: 1px solid var(--glass-border-strong);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.btn-crit {
    background: transparent;
    color: var(--status-crit);
    border: 1px solid var(--status-crit);
}
.btn-crit:hover {
    background: var(--status-crit);
    color: white;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.4);
}
.btn-icon {
    padding: 8px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--glass-border-strong);
    color: var(--mcmi-text-main);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-large { padding: 16px 32px; font-size: 1.0rem; }
.btn-small { padding: 8px 16px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* ==========================================
   CARDS & LAYOUT
   ========================================== */
.card {
    background: var(--surface-color);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    animation: fadeIn 0.5s ease forwards;
    height: 100%;
    overflow-y: auto;
}
/* Custom Scrollbar for cards */
.card::-webkit-scrollbar { width: 6px; }
.card::-webkit-scrollbar-track { background: transparent; }
.card::-webkit-scrollbar-thumb { background: var(--primary-glow); border-radius: 10px; }
/* ==========================================
   HEADER
   ========================================== */
.assessment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border-strong);
    flex-shrink: 0;
}

.assessment-logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    text-shadow: 0 0 8px var(--primary-glow);
}

.assessment-logo h1 {
    font-size: clamp(1.5rem, 2vw, 2rem);
    margin: 10px 0 0 0;
    color: var(--accent-color);
}
.assessment-info {

    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 12px;
    white-space: nowrap;
    min-width: 0;
}
.assessment-info .info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 0;
}

.assessment-info .info-item span {
    white-space: nowrap;
}

.assessment-info #theme-toggle #theme-icon {
    flex: 0 0 auto;
    width: 38px;
    /* height: auto; */
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1024px) {
    .assessment-info {
        gap: 8px;
    }

    .assessment-info .info-item {
        gap: 4px;
    }

    .assessment-info #theme-toggle #theme-icon {
        width: 34px;
        /* height: auto; */
    }
}


@media (max-width: 767px) {
    .assessment-info {
        width: 100%;
        justify-content: center;
        gap: 5px;
    }

    .assessment-info .info-item {
        gap: 3px;
        font-size: 0.8rem;
    }

    .assessment-info #theme-toggle {
        width: 30px;
        height: 30px;
    }
    .assessment-header {
    margin-bottom: 0px;
    }
    .btn { padding: 10px 20px; font-size: 0.9rem; }
    .btn-large { padding: 14px 28px; font-size: 0.95rem; }
    .btn-small { padding: 6px 12px; font-size: 0.8rem; }
}


/* ==========================================
   MAIN CONTENT SECTIONS
   ========================================== */
.assessment-main {
    position: relative;
    flex-grow: 1;
    margin-bottom: 20px;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
}
.assessment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
@media (max-width: 767px) {
    .assessment-main { height: 80vh; max-height: none; 
        padding: 0px;
    }
    .assessment-logo, .assessment-logo a {
        align-items: center;
        text-align: center;
        flex-direction: column;
        gap: 5px;
    }
    .assessment-actions button  {
        padding: 10px;
}
}
#save-status {
    font-size: 2rem;
}


/* START SECTION */
.start-header { text-align: center; margin-bottom: 30px; }
.start-header i { color: var(--primary-color); margin-bottom: 15px; text-shadow: 0 0 15px var(--primary-glow); }

.instructions {
    background: var(--bg-panel);
    border-left: 3px solid var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}
.instructions ul { list-style-position: inside; color: var(--text-muted); margin-top: 10px; }


/* QUESTION SECTION */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
/* Progress Bar Inline Layout */
.progress-container {
    flex-grow: 1;
    margin: 0 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}
.progress-bar {
    flex-grow: 1;
    height: 6px;
    background-color: var(--glass-border-strong);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: var(--progress-fill, 0%);
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    box-shadow: 0 0 10px var(--primary-glow);
    transition: width 0.4s ease;
}
#progress-percentage { color: var(--primary-color); font-weight: 700; }
.question-nav { display: flex; gap: 10px; }
.question-text {
    font-size: clamp(1.0rem, 2.0vw, 1.1rem);
    line-height: 1.8;
    margin-bottom: 40px;
    padding: 30px;
    background: var(--bg-panel);
    border-radius: var(--border-radius);
    border-right: 4px solid var(--primary-color);
    text-align: right;
    min-height: 200px;
}
.answer-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}
@media (max-width: 767px) {
    .question-text {
        margin-bottom: 0px;
        padding: 24px;
    }
    .answer-options { 
        display: flex;
        flex-direction: row;
        gap: 15px;
        justify-content: space-between;
    }
    .answer-btn {
        flex: 1;
        padding: 15px;
        font-size: clamp(0.8rem, 1.5vw, 0.9rem);
        padding: 15px;
    }
}
.answer-btn {
    padding: 20px;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: clamp(0.9rem, 1.9vw, 1.0rem);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: auto;
    transition: var(--transition);
    background: var(--bg-panel-btn);
    border: 1px solid var(--glass-border-strong);
    color: var(--mcmi-text-main);
}
.true-btn:hover, .true-btn.active {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}
.false-btn:hover, .false-btn.active {
    background: rgba(255, 0, 85, 0.1);
    border-color: var(--status-crit);
    color: var(--status-crit);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.2);
}
.question-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border-strong);
}
.quick-nav { display: flex; gap: 10px; }



.loading-content {
    text-align: center;
    padding: 60px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}
.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--glass-border-strong);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin-bottom: 20px;
}
/* RESULTS SECTION */
.results-header { text-align: center; margin-bottom: 30px; }
.results-header i { color: var(--accent-color); text-shadow: 0 0 20px rgba(255,215,0,0.5); margin-bottom: 15px; }

.summary-card {
    background: linear-gradient(135deg, rgba(180, 0, 255, 0.1), rgba(0, 229, 255, 0.1));
    border: 1px solid var(--glass-border-strong);
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}
.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.summary-stat {
    background: var(--bg-panel);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}
.summary-stat .stat-label { display: block; color: var(--mcmi-text-muted); font-size: 0.9rem; margin-bottom: 5px; }
.summary-stat .stat-value { font-size: 1rem; font-weight: 700; color: var(--mcmi-primary-color); }

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
}
/* ==========================================
   MODALS
   ========================================== */
.modal {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}
.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    overflow: hidden;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--glass-border);
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.0rem;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close:hover { color: var(--status-crit); }
.modal-body { padding: 30px 20px; text-align: center; }
.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}
/* ==========================================
   ANIMATIONS & RESPONSIVE
   ========================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@media (max-width: 767px) {
    .assessment-header { flex-direction: column; gap: 15px; }
    .assessment-info { justify-content: center; }
    .progress-container { margin: 15px 0; width: 100%; order: -1; }
    .question-header { flex-direction: column; }
    .question-header h3 { margin-bottom: 15px; font-size: 1.0rem;}
    .answer-options { 
        padding: 0;
        margin: 12px auto;
    }
    .question-content {
        padding: 0 20px;
        margin: 0;
    }
    .question-footer { flex-direction: column; gap: 20px; }
    .quick-nav { flex-wrap: wrap; justify-content: center; }
}

.input-group input #identifier {
    color: var(--text-main);
}