/* ייבוא פונט מודרני בעברית */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;700&display=swap');

:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --secondary: #2c3e50;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --text: #34495e;
    --card-bg: #ffffff;
    --bg-gradient: linear-gradient(135deg, #2c3e50 0%, #4ca1af 100%); /* רקע מעניין יותר */
    --shadow: 0 10px 20px rgba(0,0,0,0.15);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Rubik', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed; /* הרקע נשאר קבוע בגלילה */
    margin: 0;
    padding: 20px;
    direction: rtl;
    color: var(--text);
    min-height: 100vh;
}

.container {
    max-width: 850px;
    margin: 0 auto;
    padding-bottom: 50px;
}

/* --- כרטיסיות --- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* אפקט עדין בכניסה */
.fade-in { animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1); }

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

h1, h2 { color: var(--primary); margin-top: 0; font-weight: 700; text-align: center; }
.hidden { display: none !important; }

/* --- טפסים ואינפוטים --- */
.input-group { position: relative; margin: 30px 0; text-align: center; }

.input-group input {
    width: 100%;
    max-width: 400px;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 50px;
    text-align: center;
    transition: 0.3s;
    outline: none;
    font-family: 'Rubik', sans-serif;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}

/* --- כפתורים --- */
button {
    padding: 12px 35px;
    font-size: 1.1em;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Rubik', sans-serif;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    letter-spacing: 0.5px;
}

button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(0,0,0,0.18);
}

button:active:not(:disabled) { transform: translateY(-1px); }
button:disabled { opacity: 0.6; cursor: not-allowed; filter: grayscale(100%); }

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

.btn-success {
    background: var(--success);
    color: white;
    width: 100%;
    margin-top: 25px;
    font-size: 1.3em;
    padding: 15px;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    margin-top: 20px;
}
.btn-outline:hover { background: var(--primary); color: white; }

/* --- Sticky Header & Progress --- */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(44, 62, 80, 0.95); /* כהה חצי שקוף */
    backdrop-filter: blur(10px); /* אפקט זכוכית */
    padding: 15px 20px;
    margin: -20px -20px 20px -20px; /* מתיחה לצדדים */
    border-bottom: 1px solid rgba(255,255,255,0.1);
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.progress-bar {
    height: 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

/* --- טיימר צף --- */
.timer-container {
    position: fixed;
    top: 25px;
    left: 25px;
    background: white;
    padding: 8px 20px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    font-weight: 700;
    font-size: 1.3em;
    color: var(--dark);
    border: 3px solid var(--primary);
    transition: 0.3s;
}

.timer-critical {
    background-color: #fff5f5;
    color: #c0392b;
    border-color: #c0392b;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* --- עיצוב השאלות --- */
.question-card {
    text-align: right;
    border-right: 6px solid var(--primary); /* פס צבע מימין */
    padding: 25px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.question-header {
    font-size: 1.25em;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    line-height: 1.4;
}

.question-header span:first-child {
    background: var(--light);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 6px;
    height: fit-content;
    white-space: nowrap;
}

/* --- אפשרויות בחירה (רדיו) --- */
.options-grid { display: grid; gap: 10px; }

.option-label {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.05em;
}

.option-label:hover {
    background: #eef6fc;
    border-color: #bdc3c7;
}

/* כשנבחר */
.option-label:has(input:checked) {
    border-color: var(--primary);
    background: #eef6fc;
    color: var(--primary-dark);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

input[type="radio"] {
    margin-left: 15px;
    transform: scale(1.3);
    accent-color: var(--primary);
}

/* --- עיצוב קוד (Code Snippets) --- */
pre {
    background: #282c34; /* צבע רקע כמו VS Code */
    color: #abb2bf;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95em;
    overflow-x: auto;
    border-left: 4px solid #61dafb; /* פס כחול של ריאקט/נוד */
    direction: ltr !important;
    text-align: left !important;
    margin-top: 10px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

/* --- אזור בונוס --- */
.bonus-section {
    background: #fff9e6;
    border: 2px dashed var(--warning);
    border-radius: 12px;
    padding: 30px;
    margin-top: 40px;
    position: relative;
}

.bonus-section::before {
    content: '⭐ אתגר';
    position: absolute;
    top: -15px;
    right: 20px;
    background: var(--warning);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.bonus-header { color: #d35400; text-align: right; }

.bonus-warning {
    background: #ffecec;
    color: #c0392b;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 25px;
    border: 1px solid #ffcccc;
    font-weight: 500;
}

.clear-btn {
    background: #bdc3c7;
    color: white;
    padding: 6px 12px;
    font-size: 0.85em;
    margin-top: 10px;
    border-radius: 6px;
    width: auto;
    display: inline-block;
}
.clear-btn:hover { background: #95a5a6; transform: none; box-shadow: none; }

/* --- תוצאות ופירוט --- */
.score-circle {
    width: 160px; height: 160px;
    border: 12px solid #ecf0f1;
    border-radius: 50%;
    margin: 30px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5em;
    font-weight: 800;
    color: var(--secondary);
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.feedback-item {
    text-align: right;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-right: 4px solid #ccc;
    font-size: 0.95em;
}

.feedback-item span { display: block; margin-top: 5px; }

/* --- טבלאות אדמין --- */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

th { background: var(--secondary); color: white; padding: 15px; font-weight: 600; }
td { padding: 12px 15px; border-bottom: 1px solid #eee; color: #555; }
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: #f8f9fa; }

/* --- רספונסיביות --- */
@media (max-width: 600px) {
    .card { padding: 20px; }
    .timer-container { top: auto; bottom: 20px; left: 50%; transform: translateX(-50%); width: 90%; justify-content: center; }
    .sticky-header { margin: -20px -20px 10px -20px; padding: 10px 15px; }
    h1 { font-size: 1.8em; }
    .question-header { flex-direction: column; gap: 5px; }
    .question-header span:first-child { width: fit-content; }
}

/* ייבוא פונט מודרני בעברית */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;700&display=swap');

:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --secondary: #2c3e50;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --text: #34495e;
    --card-bg: #ffffff;
    --bg-gradient: linear-gradient(135deg, #2c3e50 0%, #4ca1af 100%);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%; /* חובה לביטול גלילה */
    overflow: hidden; /* חובה לביטול גלילה */
    font-family: 'Rubik', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg-gradient);
    direction: rtl;
    color: var(--text);
}

.container {
    height: 100vh;
    width: 100%;
    max-width: 700px; /* <--- הקטנה משמעותית (היה 900px) */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1vh 1vw; /* הקטנת שוליים חיצוניים */
}

/* --- כרטיסיות --- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2.5vh 2.5vw; /* <--- צמצום המרווח הפנימי */
    box-shadow: 0 1vh 3vh rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* <--- הגבלה קצת יותר הדוקה לגובה */
    transition: all 0.3s ease;
}

/* מסכי התחלה וסיום - ממורכזים */
.center-screen-card {
    align-items: center;
    justify-content: center;
    text-align: center;
    height: auto;
}

.hidden { display: none !important; }

/* --- לוגיקת מסך מלא לשאלה --- */
#quiz-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.question-layout {
    display: flex;
    flex-direction: column;
    flex: 1; /* תופס את כל הגובה הפנוי */
    justify-content: space-between; /* מפזר את התוכן */
    height: 100%;
}

.question-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2vh;
    border-bottom: 1px solid #eee;
    padding-bottom: 1vh;
}

/* טיימר בראש השאלה */
.q-timer-display {
    font-size: clamp(1.2rem, 3vh, 2rem); /* גודל דינמי */
    font-weight: bold;
    color: var(--primary);
}
.q-timer-critical { color: var(--danger); animation: pulse 1s infinite; }

.question-text-area {
    flex: 1; /* זה החלק שיתפוס הכי הרבה מקום */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 500;
    /* גודל פונט שמתאים את עצמו לגובה המסך */
    font-size: clamp(1.1rem, 3.5vh, 2rem); 
    padding: 2vh 0;
    overflow: hidden; /* מונע גלילה פנימית */
    line-height: 1.4;
}

/* אזור התשובות */
/* אזור התשובות - תיקון לתצוגה אנכית */
.options-grid {
    display: grid;
    gap: 1.5vh;
    /* שינוי: עמודה אחת בלבד תמיד */
    grid-template-columns: 1fr; 
    width: 100%;
    margin-bottom: 2vh;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 2vh 2vw;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: clamp(1rem, 2.5vh, 1.3rem); /* פונט דינמי לתשובות */
}

.option-label:hover { background: #eef6fc; border-color: #bdc3c7; }
.option-label:has(input:checked) {
    border-color: var(--primary);
    background: #eef6fc;
    color: var(--primary-dark);
    font-weight: bold;
    box-shadow: 0 0.5vh 1vh rgba(52, 152, 219, 0.15);
}

input[type="radio"] {
    margin-left: 15px;
    transform: scale(1.3);
    accent-color: var(--primary);
}

/* כפתור הבא */
.next-btn-area {
    margin-top: auto;
    width: 100%;
}

button {
    width: 100%;
    padding: 2vh;
    font-size: clamp(1rem, 2.5vh, 1.5rem);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Rubik', sans-serif;
    transition: transform 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-bonus { background: var(--warning); color: white; }

/* קוד בתוך שאלה */
pre {
    background: #282c34;
    color: #abb2bf;
    padding: 1.5vh;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-size: clamp(0.8rem, 2vh, 1.1rem);
    text-align: left !important;
    direction: ltr !important;
    max-height: 20vh; /* מגביל גובה קוד כדי לא לחרוג */
    overflow: hidden; /* בלי גלילה, אם הקוד ארוך הוא יחתך (לפי דרישה) */
    width: 100%;
}

/* אנימציות */
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.slide-animation { animation: slideIn 0.4s ease-out; }

/* בונוס ספציפי */
.bonus-indicator {
    background: var(--warning);
    color: white;
    padding: 0.5vh 1.5vw;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

/* --- תיקון גלילה למסך המנהל בלבד --- */
body.admin-scroll, 
html:has(body.admin-scroll) {
    height: auto !important;
    overflow-y: auto !important; /* מאפשר גלילה אנכית */
    overflow-x: hidden;          /* מונע גלילה רוחבית מיותרת */
}

/* מוודא שהתוכן לא נחתך */
body.admin-scroll .admin-wrapper {
    height: auto;
    min-height: 100vh;
    padding-bottom: 50px;
}

/* --- חסימת העתקה וסימון טקסט --- */
body {
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+/Edge */
    user-select: none;         /* Standard */
}

/* חובה לאפשר סימון בתוך אינפוטים כדי שיוכלו להקליד ולתקן */
input, textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* מסך חסימה אגרסיבי */
#fullscreen-blocker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #2c3e50;
    color: white;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ========== שיפור עיצוב מערכת ========== */
:root {
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.16);
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 0.25s ease;
}

/* --- דף נחיתה --- */
html.landing-page {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
}
body.landing {
    font-family: 'Rubik', sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    padding-top: 0;
    background: linear-gradient(160deg, #1a2f47 0%, #2c3e50 40%, #34495e 100%);
    color: #fff;
    overflow-x: hidden;
    overflow-y: visible;
}
body.landing .nav {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 50;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(12px);
    transition: background var(--transition);
}
body.landing .nav.scrolled { background: rgba(0,0,0,0.5); }
body.landing .logo { font-size: 1.35rem; font-weight: 800; color: #fff; }
body.landing .logo span { color: #5dade2; }
body.landing .nav-links { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
body.landing .nav-links a { color: rgba(255,255,255,0.95); text-decoration: none; font-weight: 600; transition: color var(--transition); }
body.landing .nav-links a:hover { color: #5dade2; }
body.landing .btn-cta {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    padding: 0.65rem 1.25rem;
    border-radius: 50px;
    box-shadow: 0 4px 14px rgba(52,152,219,0.4);
    transition: transform var(--transition), box-shadow var(--transition);
}
body.landing .btn-cta:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(52,152,219,0.5); }
body.landing section { max-width: 1100px; margin: 0 auto; padding: 4rem 1.5rem; }
body.landing .hero { padding-top: 6rem; padding-bottom: 3rem; text-align: center; }
body.landing .hero h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); line-height: 1.25; margin-bottom: 1rem; font-weight: 800; }
body.landing .hero h1 .accent { color: #5dade2; }
body.landing .hero p { font-size: 1.1rem; opacity: 0.92; max-width: 560px; margin: 0 auto 2rem; line-height: 1.65; }
body.landing .hero-btns { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
body.landing .hero-btns a {
    display: inline-block;
    padding: 0.95rem 1.75rem;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: transform var(--transition), box-shadow var(--transition);
}
body.landing .hero-btns a.primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    box-shadow: 0 6px 20px rgba(52,152,219,0.35);
}
body.landing .hero-btns a.primary:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(52,152,219,0.45); }
body.landing .hero-btns a.secondary {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.35);
}
body.landing .hero-btns a.secondary:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }
body.landing .features {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    margin-top: 2rem;
}
body.landing .features h2 { text-align: center; margin-bottom: 1.75rem; font-size: 1.5rem; font-weight: 700; }
body.landing .features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
body.landing .feature-card {
    background: rgba(255,255,255,0.08);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.08);
    transition: transform var(--transition), background var(--transition);
}
body.landing .feature-card:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }
body.landing .feature-card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; color: #5dade2; }
body.landing .feature-card p { margin: 0; opacity: 0.9; font-size: 0.9rem; line-height: 1.5; }
body.landing #contact {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    margin-top: 2.5rem;
}
body.landing #contact h2 { text-align: center; margin-bottom: 0.4rem; font-size: 1.5rem; }
body.landing #contact .sub { text-align: center; opacity: 0.85; margin-bottom: 1.5rem; font-size: 0.95rem; }
body.landing .form-box {
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    color: #2c3e50;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
body.landing .form-box label { display: block; font-weight: 700; margin-bottom: 0.35rem; font-size: 0.8rem; color: #555; }
body.landing .form-box input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #e8ecf0;
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}
body.landing .form-box input:focus { outline: none; border-color: #3498db; box-shadow: 0 0 0 4px rgba(52,152,219,0.15); }
body.landing .form-box button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: opacity var(--transition), transform var(--transition);
}
body.landing .form-box button:hover:not(:disabled) { opacity: 0.95; transform: translateY(-1px); }
body.landing .form-box button:disabled { opacity: 0.7; cursor: not-allowed; }
body.landing .form-note { font-size: 0.78rem; color: #777; text-align: center; margin-top: 1rem; line-height: 1.4; }
body.landing .lead-msg { text-align: center; padding: 0.65rem; margin-top: 0.75rem; font-weight: 600; border-radius: 10px; font-size: 0.9rem; }
body.landing .lead-msg.success { background: #d4edda; color: #155724; }
body.landing .lead-msg.error { background: #f8d7da; color: #721c24; }
body.landing .footer { text-align: center; padding: 2rem; opacity: 0.85; font-size: 0.9rem; }
body.landing .footer a { color: #5dade2; text-decoration: none; }
body.landing .footer a:hover { text-decoration: underline; }

/* --- מסך נעילה מרצה (אדמין) --- */
#lock-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(160deg, #1a2f47 0%, #2c3e50 50%, #34495e 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
}
#lock-screen h2 { margin: 0 0 0.5rem; font-size: 1.75rem; font-weight: 800; }
#lock-screen p#lock-desc { opacity: 0.9; margin-bottom: 1.5rem; font-size: 0.95rem; }
#lock-screen input {
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: #fff;
    min-width: 280px;
    max-width: 100%;
    text-align: center;
    font-family: inherit;
    transition: border-color var(--transition), background var(--transition);
}
#lock-screen input::placeholder { color: rgba(255,255,255,0.5); }
#lock-screen input:focus { outline: none; border-color: #5dade2; background: rgba(255,255,255,0.15); }
#lock-screen button {
    margin-top: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: transform var(--transition), box-shadow var(--transition);
}
#lock-screen button:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(52,152,219,0.4); }
#lock-screen #step-email, #lock-screen #step-code { display: flex; flex-direction: column; align-items: center; }
#lock-screen #lock-msg { margin-top: 1rem; font-size: 0.9rem; min-height: 1.5rem; }
#lock-screen a { color: rgba(255,255,255,0.85); font-size: 0.85rem; margin-top: 1rem; text-decoration: none; }
#lock-screen a:hover { color: #5dade2; text-decoration: underline; }

/* --- מודל צ'אט אדמין --- */
#adminChatModal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-width: 95vw;
    background: #fff;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#adminChatModal > div:first-child {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#adminChatModal #adminChatBody { height: 300px; overflow-y: auto; padding: 1rem; background: #f4f6f7; }
#adminChatModal input { flex: 1; padding: 0.65rem 1rem; border: 2px solid #e8ecf0; border-radius: 10px; font-family: inherit; margin-left: 0.5rem; }
#adminChatModal input:focus { outline: none; border-color: var(--primary); }
#adminChatModal .modal-send-btn { background: var(--success); color: #fff; border: none; padding: 0.65rem 1rem; border-radius: 10px; cursor: pointer; font-weight: 600; }

/* --- כרטיסיות אדמין משופרות --- */
body.admin-scroll .setup-section {
    background: #fff;
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0,0,0,0.06);
}
body.admin-scroll .timer-display-admin {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin: 1.5rem 0;
    color: #2c3e50;
    background: #fff;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 3px solid var(--primary);
    box-shadow: var(--shadow-sm);
}
body.admin-scroll .start-exam-btn {
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: #fff;
    padding: 1rem 1.5rem;
    flex: 1;
    border-radius: var(--radius-lg);
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}
body.admin-scroll .start-exam-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(39,174,96,0.35); }
body.admin-scroll .stop-exam-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    padding: 1rem 1.5rem;
    flex: 1;
    border-radius: var(--radius-lg);
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}
body.admin-scroll .stop-exam-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(231,76,60,0.35); }
body.admin-scroll .tab-btn {
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all var(--transition);
}
body.admin-scroll .tab-btn.active { background: var(--primary); color: #fff; }
body.admin-scroll .live-monitor {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}
body.admin-scroll .student-card {
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    text-align: center;
    transition: box-shadow var(--transition);
}
body.admin-scroll .student-card:hover { box-shadow: var(--shadow-sm); }
body.admin-scroll .camera-grid { gap: 0.75rem; }
body.admin-scroll .cam-feed { border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
body.admin-scroll table { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
body.admin-scroll th { padding: 1rem 1.25rem; font-weight: 700; }
body.admin-scroll td { padding: 1rem 1.25rem; }
body.admin-scroll .email-btn {
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
    color: #fff;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    transition: transform var(--transition);
}
body.admin-scroll .email-btn:hover { transform: translateY(-2px); }
body.admin-scroll .alerts-box .setup-section, body.admin-scroll .alerts-box { border-radius: var(--radius-lg); }
#alertsList { border-radius: 10px; padding: 0.75rem; }

/* --- מסך חסימה סטודנט (מסך מלא) --- */
#fullscreen-blocker {
    background: linear-gradient(160deg, #1a2f47 0%, #2c3e50 100%);
    padding: 2rem;
}
#fullscreen-blocker h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); margin-bottom: 1rem; }
#fullscreen-blocker p { font-size: 1.05rem; opacity: 0.95; margin: 0.5rem 0; }
#fullscreen-blocker .btn-primary {
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(52,152,219,0.4);
    transition: transform var(--transition);
}
#fullscreen-blocker .btn-primary:hover { transform: translateY(-2px); }

/* --- מסך כניסה סטודנט --- */
#login-screen.card {
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.15);
}
#login-screen #studentName {
    border-radius: 50px;
    border: 2px solid #e0e0e0;
    padding: 1rem 1.25rem;
    font-size: 1.1em;
    transition: border-color var(--transition), box-shadow var(--transition);
}
#login-screen #studentName:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(52,152,219,0.15); }
#security-terms {
    background: #fff8f8;
    border: 1px solid #fecaca;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: right;
    font-size: 0.9em;
    color: #742a2a;
}
#security-terms h4 { margin-top: 0; color: #c53030; text-align: center; }
#waiting-area p { color: #ea580c; font-weight: 700; }
#waiting-area button { border-radius: 10px; padding: 0.65rem 1rem; transition: background var(--transition); }

/* --- מסך תוצאות סטודנט --- */
#result-screen h2 { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: 0.5rem; }
#result-screen #finalScore { font-size: clamp(2.5rem, 8vw, 4rem); font-weight: 800; }
#result-screen .email-report-box {
    margin: 1.25rem 0;
    padding: 1.25rem;
    background: #f0f9ff;
    border-radius: var(--radius-lg);
    border: 1px solid #bae6fd;
}
#result-screen .email-report-box input {
    padding: 0.65rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color var(--transition);
}
#result-screen .email-report-box input:focus { outline: none; border-color: var(--primary); }
#result-screen #sendMailBtn {
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    transition: transform var(--transition);
}
#result-screen #sendMailBtn:hover { transform: translateY(-1px); }

/* --- וידאו/קנבס מצלמה (סטודנט) --- */
#snapshotCanvas {
    border-radius: 12px;
    border: 2px solid var(--success);
    box-shadow: 0 4px 16px rgba(46,204,113,0.3);
}
#snapshotCanvas + div {
    border-radius: 0 0 12px 12px;
    font-size: 0.7rem;
    padding: 0.35rem;
}

@media (max-width: 768px) {
    body.landing .nav { padding: 0.75rem 1rem; }
    body.landing .nav-links { gap: 0.75rem; }
    body.landing .nav-links .btn-cta { padding: 0.5rem 1rem; font-size: 0.9rem; }
    body.landing .hero { padding-top: 5rem; }
    body.landing .features { padding: 1.5rem; }
    body.landing .form-box { margin: 0 1rem; padding: 1.5rem; }
    #lock-screen { padding: 1.5rem; }
    #lock-screen input { min-width: 100%; box-sizing: border-box; }
}
