/* =========================================
   1. GLOBAL RESET & SECURITY
   ========================================= */
body { 
    margin: 0; 
    background: #f0f2f5; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    color: #333;
    line-height: 1.6;
    
    /* 🔒 STRICT SECURITY: Disable Text Selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow typing in input fields */
input, textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    font-family: inherit;
}

/* 🔒 BLUR EFFECT (When Focus is Lost) */
.eat-blurred .eat-container, 
.eat-blurred .eat-top-bar {
    filter: blur(15px);
    pointer-events: none;
    opacity: 0.4;
}

.eat-blurred::after {
    content: "⚠️ SECURITY ALERT! \A \A You switched tabs or lost focus. \A Content Hidden.";
    white-space: pre;
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); 
    color: #fff; 
    display: flex;
    justify-content: center; 
    align-items: center; 
    font-size: 24px; 
    font-weight: bold;
    text-align: center;
    z-index: 99999;
}

/* =========================================
   2. LOGIN & GUIDE UI
   ========================================= */
.eat-card-center {
    background: #fff; 
    padding: 40px; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    margin: 60px auto; 
    max-width: 450px; 
    text-align: center;
    border-top: 5px solid #007bff;
}

.eat-card-center h2 { color: #007bff; margin-top: 0; }

.eat-card-center input[type="text"], 
.eat-card-center input[type="email"] {
    width: 100%; 
    padding: 12px; 
    margin: 10px 0; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    box-sizing: border-box; 
    font-size: 16px;
}

/* Guidelines Box */
.eat-guide-box {
    text-align: left; 
    background: #f9f9f9; 
    padding: 20px; 
    height: auto; 
    max-height: 400px;
    overflow-y: auto; 
    border: 1px solid #eee; 
    margin-bottom: 20px; 
    border-radius: 4px;
}

/* =========================================
   3. EXAM LAYOUT (2-COLUMN: 75% | 25%)
   ========================================= */
#eat-step-exam { display: none; }

.eat-top-bar {
    background: #007bff; 
    color: white; 
    padding: 12px 30px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    position: sticky; 
    top: 0; 
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.eat-timer { 
    background: rgba(0,0,0,0.2); 
    padding: 5px 15px; 
    border-radius: 4px; 
    font-weight: bold; 
    font-size: 18px; 
}

.eat-container {
    display: flex; 
    gap: 20px; 
    padding: 20px; 
    height: calc(100vh - 70px); 
    box-sizing: border-box; 
    max-width: 1600px; 
    margin: 0 auto;
}

/* Left Content (Question) */
.eat-col-left { 
    flex: 3; /* 75% Width */
    background: #fff; 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
}

/* Right Sidebar (Camera/Grid) */
.eat-col-right { 
    flex: 1; /* 25% Width */
    min-width: 280px;
    max-width: 350px;
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
}

/* =========================================
   4. QUESTION & OPTIONS
   ========================================= */
#eat-sec-badge { 
    background: #ffc107; 
    color: #000; 
    display: inline-block; 
    padding: 5px 12px; 
    border-radius: 4px; 
    font-weight: bold; 
    font-size: 12px; 
    margin-bottom: 20px; 
}

#eat-q-container h3 { 
    margin-top: 0; 
    border-bottom: 1px solid #eee; 
    padding-bottom: 15px; 
    margin-bottom: 20px; 
    color: #007bff; 
}

.eat-q-text { 
    font-size: 18px; 
    line-height: 1.7; 
    color: #333; 
    margin-bottom: 25px; 
}
.eat-q-text img { max-width: 100%; border-radius: 5px; margin-top: 10px; }

/* Option Cards */
.eat-option-card {
    display: flex; 
    align-items: center; 
    padding: 15px; 
    border: 1px solid #ddd; 
    margin-bottom: 12px; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: 0.2s; 
    background: #fff;
    font-size: 16px;
}

.eat-option-card:hover { background: #f0f8ff; border-color: #007bff; }

.eat-option-card.selected { 
    background: #e7f1ff; 
    border-color: #007bff; 
    font-weight: bold; 
    box-shadow: 0 0 5px rgba(0,123,255,0.2);
}

.eat-opt-circle {
    width: 32px; height: 32px; 
    background: #eee; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-right: 15px; 
    font-weight: bold; 
    color: #555;
    flex-shrink: 0;
}

.eat-option-card.selected .eat-opt-circle { background: #007bff; color: white; }

/* Manual Answer Textarea */
#eat-text-answer { 
    width: 100%; 
    height: 250px; 
    padding: 15px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    display: none; /* Hidden by default */
    box-sizing: border-box; 
    font-size: 16px;
    resize: vertical;
}

/* =========================================
   5. SIDEBAR COMPONENTS
   ========================================= */
/* Camera Box */
.eat-cam-box { 
    background: #000; 
    position: relative; 
    height: 220px; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

#eat-video { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.eat-rec-badge { 
    position: absolute; 
    top: 10px; right: 10px; 
    color: white; 
    font-size: 11px; 
    font-weight: bold; 
    background: red; 
    padding: 3px 8px; 
    border-radius: 3px; 
    animation: blink 1.5s infinite; 
}
@keyframes blink { 0% {opacity: 1;} 50% {opacity: 0.5;} 100% {opacity: 1;} }

/* Palette */
.eat-palette-box { 
    background: #fff; 
    padding: 15px; 
    border-radius: 8px; 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.eat-palette-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 10px;
    font-weight: bold;
    color: #555;
}

#eat-grid-view { 
    display: grid; 
    grid-template-columns: repeat(5, 1fr); 
    gap: 8px; 
    overflow-y: auto; 
    align-content: flex-start; 
}

.eat-grid-item { 
    height: 35px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    font-size: 13px; 
    background: #f9f9f9;
}

.eat-grid-item.current { border: 2px solid #007bff; color: #007bff; background: #fff; font-weight: bold; }
.eat-grid-item.answered { background: #28a745; color: white; border-color: #28a745; }

/* =========================================
   6. BUTTONS & PREVIEW
   ========================================= */
.eat-nav-buttons { 
    display: flex; 
    justify-content: space-between; 
    margin-top: 30px; 
    padding-top: 20px; 
    border-top: 1px solid #eee; 
}

.eat-btn-primary { 
    background: #007bff; color: white; border: none; 
    padding: 12px 25px; border-radius: 4px; cursor: pointer; font-size: 15px; 
}
.eat-btn-primary:hover { background: #0056b3; }
.eat-btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.eat-btn-secondary { 
    background: #6c757d; color: white; border: none; 
    padding: 12px 25px; border-radius: 4px; cursor: pointer; font-size: 15px; 
}
.eat-btn-secondary:hover { background: #5a6268; }

/* Preview Table */
#eat-preview-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
#eat-preview-table th { text-align: left; background: #f1f1f1; padding: 10px; border-bottom: 2px solid #ddd; }
#eat-preview-table td { padding: 10px; border-bottom: 1px solid #eee; }
#eat-preview-table tr:hover { background: #f9f9f9; }

/* =========================================
   7. POPUP MODAL (FIXED OVERLAY)
   ========================================= */
.eat-modal-overlay { 
    position: fixed !important; 
    top: 0; left: 0; right: 0; bottom: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.85); 
    z-index: 999999; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

.eat-popup-box { 
    background: white; 
    padding: 40px; 
    border-radius: 10px; 
    text-align: center; 
    width: 90%; 
    max-width: 400px; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.3); 
    position: relative;
    animation: popUp 0.3s ease-out;
}

@keyframes popUp {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .eat-container { flex-direction: column; height: auto; }
    .eat-col-right { width: 100%; max-width: none; flex-direction: row; }
    .eat-cam-box { width: 150px; height: 120px; }
    .eat-palette-box { flex: 1; }
}