:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #ccfbf1;
    --secondary: #f59e0b;
    --secondary-light: #fef3c7;
    --bg-gradient: linear-gradient(135deg, #f0fdf4 0%, #e6f4ea 50%, #f0f9ff 100%);
    --card-bg: rgba(255, 255, 255, 0.92);
    --card-border: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-soft: 0 10px 30px -5px rgba(15, 118, 110, 0.08);
    --shadow-hover: 0 20px 35px -5px rgba(15, 118, 110, 0.15);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', sans-serif; }
body { background: var(--bg-gradient); color: var(--text-main); min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; position: relative; }

.bg-shape { position: absolute; border-radius: 50%; filter: blur(80px); z-index: -1; opacity: 0.5; }
.shape-1 { width: 350px; height: 350px; background: #a7f3d0; top: -50px; left: -50px; }
.shape-2 { width: 400px; height: 400px; background: #fef08a; bottom: -100px; right: -50px; }

#navbar { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); padding: 0.85rem 2rem; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--card-border); }
.logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.25rem; color: var(--primary-dark); }
.logo-icon { background: var(--primary); color: white; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 10px; }
.logo-text span { color: var(--secondary); }

.nav-links { display: flex; gap: 0.5rem; }
.nav-btn { background: transparent; border: none; padding: 0.6rem 1.1rem; font-weight: 600; font-size: 0.9rem; color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; gap: 0.5rem; }
.nav-btn:hover { background-color: var(--primary-light); color: var(--primary-dark); }
.nav-btn-danger:hover { background-color: #fee2e2; color: #ef4444; }

.main-container { flex: 1; display: flex; justify-content: center; align-items: center; padding: 2rem 1rem; }
.page { display: none; width: 100%; max-width: 850px; justify-content: center; animation: fadeIn 0.35s ease-out forwards; }
.page.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.card { background: var(--card-bg); backdrop-filter: blur(16px); border: 1px solid var(--card-border); padding: 2.5rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); width: 100%; }
.card-login { max-width: 440px; text-align: center; }
.badge-tag { display: inline-block; background: var(--primary-light); color: var(--primary-dark); font-weight: 700; font-size: 0.78rem; padding: 0.35rem 0.85rem; border-radius: 20px; margin-bottom: 1rem; }
.bg-amber-tag { background: var(--secondary-light); color: #b45309; }
.modern-title { font-size: 2rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 0.3rem; }
.subtitle { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1.8rem; }

.input-group { position: relative; margin-bottom: 1.2rem; }
.input-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
input[type="text"], input[type="password"] { width: 100%; padding: 0.85rem 1rem 0.85rem 2.8rem; border: 1.5px solid var(--border-color); border-radius: var(--radius-sm); font-size: 0.95rem; }
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12); }

.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; border: none; padding: 0.85rem 1.5rem; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; width: 100%; }
.btn-secondary { background: #ffffff; color: var(--text-main); border: 1.5px solid var(--border-color); padding: 0.85rem 1.5rem; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; }
.teacher-link-container { margin-top: 1.5rem; }
.teacher-link-container a { color: var(--primary-dark); text-decoration: none; font-weight: 600; font-size: 0.88rem; }

.welcome-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; }
.progress-badge { background: var(--primary-light); color: var(--primary-dark); padding: 0.4rem 1rem; border-radius: 20px; font-size: 0.85rem; }
.progress-container { background: #e2e8f0; border-radius: 20px; height: 10px; overflow: hidden; margin-bottom: 2rem; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 20px; }

.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.menu-card { background: #ffffff; border: 1px solid var(--border-color); padding: 1.5rem; border-radius: var(--radius-md); cursor: pointer; display: flex; flex-direction: column; }
.menu-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 1rem; }
.bg-emerald { background: var(--primary-light); color: var(--primary-dark); }
.bg-amber { background: var(--secondary-light); color: #b45309; }
.bg-blue { background: #dbeafe; color: #1d4ed8; }
.bg-purple { background: #f3e8ff; color: #6b21a8; }

.arabic-box { background: #f8fafc; border-right: 4px solid var(--primary); padding: 1.2rem 1.5rem; border-radius: var(--radius-sm); margin: 1rem 0; display: flex; flex-direction: column; align-items: flex-end; }
.arabic-text { font-family: 'Amiri', serif; font-size: 2.2rem; color: #064e3b; direction: rtl; }
.arabic-inline { font-family: 'Amiri', serif; font-size: 1.4rem; color: var(--primary-dark); }

.simulation-box { background: #ffffff; padding: 1.8rem; border-radius: var(--radius-md); border: 1px solid var(--border-color); margin: 1.5rem 0; }
.interactive-text { display: flex; justify-content: center; gap: 0.8rem; margin: 1.5rem 0; direction: rtl; }
.interactive-text .word { font-family: 'Amiri', serif; font-size: 1.8rem; padding: 0.4rem 1.2rem; background: #f1f5f9; border-radius: var(--radius-sm); cursor: pointer; }

.feedback-box { padding: 1rem; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600; }
.feedback-box.success { background: #dcfce7; color: #15803d; }
.feedback-box.error { background: #fee2e2; color: #b91c1c; }

.quiz-item { background: #ffffff; border: 1px solid var(--border-color); padding: 1.2rem; border-radius: var(--radius-md); margin-bottom: 1.2rem; }
.quiz-question { font-weight: 700; margin-bottom: 0.8rem; }
.radio-option { display: block; padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); cursor: pointer; }

.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.table-responsive { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
table { width: 100%; border-collapse: collapse; background: #ffffff; font-size: 0.9rem; }
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
th { background: #f8fafc; font-weight: 700; }
.hidden { display: none !important; }

@media (max-width: 640px) { .menu-grid { grid-template-columns: 1fr; } }