/* تنسيقات عامة وتأثير النجوم */
body, html {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  direction: rtl; /* لدعم اللغة العربية */
  transition: background 0.6s ease-in-out, color 0.3s ease;
  background-color: #1a0b2e; /* لون مبدئي غامق جداً */
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
  box-sizing: border-box;
}

/* 🌌 تأثير النجوم الموزعة على كامل الشاشة */
.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: 
    radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 40px),
    radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 30px),
    radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 40px);
  background-size: 550px 550px, 350px 350px, 250px 250px;
  background-position: 0 0, 40px 60px, 130px 270px;
  z-index: 1;
  opacity: 0.65; /* نجوم هادئة غير مزعجة */
}

/* ☁️ تأثير السحاب الهادئ لولي الأمر */
.clouds {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: 
    radial-gradient(circle at 20% 25%, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 25%),
    radial-gradient(circle at 75% 65%, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 30%),
    radial-gradient(circle at 50% 85%, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 20%);
  z-index: 1;
}

/* --- 🎨 لوحة الألوان الغامقة والهادئة الجديدة --- */

/* 🔑 صفحة الدخول: بنفسجي ليلي غامق وهادئ */
.theme-login { 
  background: linear-gradient(135deg, #1d0a2b, #100620); 
  color: #e2d5f0; 
}

/* ⬛ المدير: أسود ليل فحم غامق ومريح */
.theme-admin { 
  background: linear-gradient(135deg, #0b0c10, #1f2833); 
  color: #c5c6c7; 
}

/* 🟦 المعلمين: أزرق بترولي غامق وناعم */
.theme-teacher { 
  background: linear-gradient(135deg, #1b2a47, #101726); 
  color: #d1dcff; 
}

/* 🟥 الطالب: نبيتي/عنابي غامق ومطفي هادئ */
.theme-student { 
  background: linear-gradient(135deg, #3b1322, #210711); 
  color: #f7d6e0; 
}

/* 🩵 ولي الأمر: سماوي ليلي غامق (تركواز داكن هادئ متناسق مع السحاب) */
.theme-parent { 
  background: linear-gradient(135deg, #1d3344, #0f1b24); 
  color: #e4f0fa; 
}


/* --- تنسيق النوافذ والجداول لتناسب الألوان الغامقة --- */
.login-box, .dashboard-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 35px;
  border-radius: 20px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  text-align: center;
  z-index: 2;
  box-sizing: border-box;
}

.dashboard-card { 
  display: none; 
  max-width: 850px; 
  text-align: right; 
}

h2, h3, h4 {
  margin-top: 0;
  font-weight: 500;
  letter-spacing: 0.5px;
}

hr {
  border: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 20px 0;
}

/* التعديل على الحقول والقوائم */
select, input {
  width: 100%;
  padding: 14px;
  margin: 12px 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.3s;
}

select:focus, input:focus {
  border-color: rgba(255, 255, 255, 0.4);
}

select option {
  background: #1a1a1a;
  color: #fff;
}

/* الأزرار */
button { 
  width: 100%;
  padding: 14px;
  margin: 12px 0;
  border-radius: 10px;
  border: none;
  font-size: 16px;
  font-weight: bold;
  box-sizing: border-box;
  background: linear-gradient(90deg, #388e3c, #4caf50); 
  color: white; 
  cursor: pointer; 
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.2);
  transition: transform 0.2s, opacity 0.2s;
}

button:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.btn-logout { 
  background: linear-gradient(90deg, #d9534f, #c9302c); 
  box-shadow: 0 4px 15px rgba(217, 83, 79, 0.2);
  margin-top: 25px; 
}

/* الجداول */
table { 
  width: 100%; 
  border-collapse: collapse; 
  margin-top: 20px; 
  background: rgba(0, 0, 0, 0.2); 
  border-radius: 8px;
  overflow: hidden;
}

th, td { 
  border: 1px solid rgba(255, 255, 255, 0.06); 
  padding: 14px; 
  text-align: center; 
  font-size: 14px;
}

th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.section-view { display: none; }