* {
  margin: 0;
  padding: 0;
  outline: none;
  text-decoration: none;
  list-style: none;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
}

header {
  background: linear-gradient(135deg, #edb82d 0%, #f5c84f 100%);
  padding: 15px 30px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(237, 184, 45, 0.3);
  position: sticky;
  top: 0;
  z-index: 999;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

nav img {
  width: 200px;
  height: auto;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.1));
  transition: transform 0.3s ease;
}

nav img:hover {
  transform: scale(1.05);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

nav ul li a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  font-size: 18px;
  padding: 10px 20px;
  transition: all 0.3s ease;
  border-radius: 25px;
  position: relative;
  overflow: hidden;
}

nav ul li a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.3);
  transition: left 0.4s ease;
  z-index: -1;
}

nav ul li a:hover::before {
  left: 0;
}

nav ul li a:hover {
  background-color: rgba(255,255,255,0.4);
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#login-item a::before {
  display: none !important;
}

#login-item a:hover {
  background-color: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

/* المودال - تصميم خرافي */
.modal {
  width: 94%;
  max-width: 920px;
  margin: 30px auto;
  border-radius: 20px;
  overflow: hidden;
  background: white;
  box-shadow: 0 15px 60px rgba(0, 0, 0, 0.2);
  transition: all 0.4s ease;
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 70px rgba(237, 184, 45, 0.3);
}

.modal-info {
  width: 100%;
  background-image: url('../images/elc-bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
}

.modal-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(237, 184, 45, 0.15), rgba(255, 255, 255, 0.85));
  backdrop-filter: blur(2px);
}

.info {
  width: 90%;
  margin: auto;
  padding: 40px 0;
  position: relative;
  z-index: 1;
}

/* العناوين - تصميم فخم */
h2 {
  font-size: 2.5rem;
  text-align: center;
  margin: 1rem 0;
  color: #2c3e50;
  font-weight: 800;
  text-shadow: 2px 2px 8px rgba(237, 184, 45, 0.3);
  letter-spacing: -1px;
  position: relative;
  display: inline-block;
  width: 100%;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #edb82d, #f5c84f);
  border-radius: 2px;
}

h3 {
  font-size: 1.3rem;
  text-align: center;
  color: #6b4f08;
  margin: 1rem 0;
  font-weight: 600;
  font-style: italic;
}

h5 {
  font-size: 1.1rem;
  text-align: center;
  color: #555;
  margin: 1rem 0;
  font-weight: 500;
}

h4 {
  font-size: 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
  color: #2c3e50;
  font-weight: 700;
  position: relative;
  padding-bottom: 10px;
}

h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #edb82d, #f5c84f);
  border-radius: 2px;
}

/* الفورم كونتينر */
.form-container {
  display: flex;
  justify-content: space-between;
  margin: 25px 0;
  gap: 25px;
  padding: 0 25px;
}

.input-section {
  width: 48%;
  flex-shrink: 0;
}

.subject-section {
  width: 52%;
  padding: 25px;
  max-height: 520px;
  overflow-y: auto;
  border: 3px solid #edb82d;
  border-radius: 15px;
  background: linear-gradient(135deg, #fff9e6, #ffffff);
  box-shadow: inset 0 2px 15px rgba(237, 184, 45, 0.1);
  position: relative;
}

.subject-section::before {
  content: '📚';
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 2rem;
  opacity: 0.2;
}

/* تحسين شريط التمرير */
.subject-section::-webkit-scrollbar {
  width: 8px;
}

.subject-section::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 10px;
}

.subject-section::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #edb82d, #f5c84f);
  border-radius: 10px;
  border: 2px solid #f8f9fa;
}

.subject-section::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #d9a524, #edb82d);
}

/* الفورم ليست */
.form-list {
  margin-top: 1.5rem;
}

.form-list-row {
  margin: 1.2rem 0;
  position: relative;
}

.form-list-row label {
  font-size: 0.95rem;
  display: block;
  margin-bottom: 8px;
  color: #2c3e50;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.form-list-row label::before {
  content: '▸';
  color: #edb82d;
  font-weight: bold;
}

.form-list-row input {
  width: 100%;
  font-size: 1rem;
  padding: 14px 15px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  background: #f8f9fa;
  transition: all 0.3s ease;
}

.form-list-row input:focus {
  border-color: #edb82d;
  box-shadow: 0 0 0 4px rgba(237, 184, 45, 0.1);
  background: white;
  transform: translateY(-2px);
}

.form-list-row small {
  display: block;
  margin-top: 5px;
  color: #6c757d;
  font-size: 0.85rem;
  font-style: italic;
}

/* شريط البحث - تصميم جذاب */
.search-container {
  margin-bottom: 20px;
  position: relative;
}

.search-container input {
  width: 100%;
  padding: 15px 50px 15px 20px;
  border: 3px solid #edb82d;
  border-radius: 30px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
  box-shadow: 0 4px 15px rgba(237, 184, 45, 0.2);
}

.search-container input:focus {
  border-color: #d9a524;
  box-shadow: 0 6px 25px rgba(237, 184, 45, 0.3);
  transform: translateY(-2px);
}

.search-container::after {
  content: '🔍';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
}

/* الأزرار - تصميم خرافي */
button[type="submit"] {
  color: white;
  font-size: 1.1rem;
  margin: 25px auto;
  padding: 15px 40px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #cdb196, #b59779);
  box-shadow: 0 8px 25px rgba(205, 177, 150, 0.4);
  transition: all 0.4s ease;
  display: block;
  width: 100%;
  max-width: 300px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
}

button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button[type="submit"]:hover::before {
  width: 400px;
  height: 400px;
}

button[type="submit"]:hover {
  background: linear-gradient(135deg, #b59779, #a0856b);
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(205, 177, 150, 0.5);
}

button[type="submit"]:active {
  transform: translateY(-2px);
}

/* المواد - تصميم كارت مميز */
.subject-item {
  display: flex;
  align-items: center;
  margin: 1rem 0;
  padding: 18px;
  border: 2px solid #f8f9fa;
  border-radius: 15px;
  background: white;
  transition: all 0.4s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
}

.subject-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(237, 184, 45, 0.1), transparent);
  transition: left 0.6s ease;
}

.subject-item:hover::before {
  left: 100%;
}

.subject-item:hover {
  border-color: #edb82d;
  box-shadow: 0 8px 25px rgba(237, 184, 45, 0.3);
  transform: translateX(5px);
}

.subject-item:has(input[type="checkbox"]:checked) {
  background: linear-gradient(135deg, rgba(237, 184, 45, 0.1), rgba(245, 200, 79, 0.05));
  border-color: #edb82d;
  border-width: 3px;
  box-shadow: 0 0 0 4px rgba(237, 184, 45, 0.1);
}

.subject-content {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 5px;
  width: 100%;
}

.subject-details {
  font-size: 0.95rem;
  flex: 1;
}

.subject-details strong {
  display: block;
  margin-bottom: 6px;
  color: #2c3e50;
  font-size: 1.05rem;
}

.subject-details span {
  color: #28a745;
  font-weight: 700;
  font-size: 1rem;
}

.subject-details small {
  display: block;
  margin-top: 4px;
  color: #6c757d;
  font-size: 0.85rem;
  line-height: 1.4;
}

.subject-image {
  width: 75px;
  height: 75px;
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid #edb82d;
  transition: all 0.4s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.subject-image:hover {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 8px 20px rgba(237, 184, 45, 0.4);
}

.subject-icon {
  width: 75px;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: linear-gradient(135deg, #edb82d, #f5c84f);
  border-radius: 12px;
  color: white;
  box-shadow: 0 4px 15px rgba(237, 184, 45, 0.3);
  transition: transform 0.3s ease;
}

.subject-icon:hover {
  transform: rotate(10deg) scale(1.1);
}

input[type="checkbox"].checkbox {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #edb82d;
  transition: transform 0.2s ease;
}

input[type="checkbox"].checkbox:hover {
  transform: scale(1.15);
}

input[type="checkbox"].checkbox:checked {
  transform: scale(1.2);
}

/* الشروط - تصميم جذاب */
.terms-section {
  margin: 25px 0;
  padding: 25px;
  border: 3px solid #edb82d;
  border-radius: 15px;
  background: linear-gradient(135deg, #fff9e6, #ffffff);
  text-align: left;
  font-size: 1rem;
  box-shadow: 0 4px 20px rgba(237, 184, 45, 0.15);
}

.terms-section a {
  display: block;
  margin-bottom: 15px;
  color: #007bff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

.terms-section a::after {
  content: '→';
  margin-left: 8px;
  transition: margin-left 0.3s ease;
}

.terms-section a:hover {
  color: #0056b3;
  transform: translateX(5px);
}

.terms-section a:hover::after {
  margin-left: 15px;
}

.terms-section div {
  display: flex;
  align-items: center;
}

.terms-section input[type="checkbox"] {
  width: 24px;
  height: 24px;
  margin-right: 12px;
  accent-color: #edb82d;
  cursor: pointer;
}

.terms-section label {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  cursor: pointer;
  flex: 1;
}

/* الرسائل */
.message-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 3px solid #edb82d;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  width: 420px;
  max-width: 90%;
  z-index: 1000;
  padding: 30px;
  text-align: center;
  animation: modalBounceIn 0.5s ease;
}

@keyframes modalBounceIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.8);
  }
  50% {
    transform: translate(-50%, -45%) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.message-content {
  margin-bottom: 25px;
  color: #2c3e50;
  font-size: 1.15rem;
  font-weight: 600;
}

.close-message {
  background: linear-gradient(135deg, #28a745, #34ce57);
  color: white;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.close-message:hover {
  background: linear-gradient(135deg, #218838, #28a745);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

/* ========== ريسبونسف محسن ========== */

@media (max-width: 1024px) {
  html {
    font-size: 13px;
  }
  
  .modal {
    width: 96%;
  }
  
  .form-container {
    gap: 20px;
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 12px;
  }
  
  .modal {
    width: 98%;
    margin: 15px auto;
  }
  
  /* الفورم يصير عمودي */
  .form-container {
    flex-direction: column;
    gap: 20px;
    padding: 0 15px;
  }
  
  /* الإنبوت أول */
  .input-section {
    width: 100%;
    order: 1;
  }
  
  /* السبجكت ثاني */
  .subject-section {
    width: 100%;
    order: 2;
    max-height: 400px;
    padding: 20px;
  }
  
  /* الشروط والأزرار - للجوال فقط */
  .mobile-footer {
    display: block;
    order: 3;
    width: 100%;
  }
  
  /* إخفاء الشروط والأزرار من input-section في الجوال */
  .input-section .terms-section,
  .input-section button[type="submit"] {
    display: none;
  }
  
  header {
    padding: 12px 20px;
  }
  
  nav {
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  nav img {
    width: 150px;
  }
  
  nav ul {
    gap: 10px;
    width: 100%;
    justify-content: center;
  }
  
  nav ul li a {
    font-size: 15px;
    padding: 8px 15px;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  h4 {
    font-size: 1.3rem;
  }
  
  .info {
    padding: 25px 0;
  }
}

@media (min-width: 769px) {
  /* إخفاء الـ mobile-footer في الشاشات الكبيرة */
  .mobile-footer {
    display: none;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 11px;
  }
  
  .modal {
    width: 99%;
    margin: 10px auto;
    border-radius: 15px;
  }
  
  .form-container {
    padding: 0 12px;
    gap: 15px;
  }
  
  .subject-section {
    max-height: 350px;
    padding: 15px;
  }
  
  nav {
    flex-direction: column;
    padding: 10px 15px;
  }
  
  nav img {
    width: 130px;
  }
  
  nav ul {
    gap: 8px;
  }
  
  nav ul li a {
    font-size: 14px;
    padding: 7px 12px;
  }
  
  h2 {
    font-size: 1.7rem;
  }
  
  .subject-content {
    gap: 10px;
  }
  
  .subject-image, .subject-icon {
    width: 65px;
    height: 65px;
  }
  
  .subject-icon {
    font-size: 28px;
  }
  
  button[type="submit"] {
    padding: 14px 30px;
    font-size: 1rem;
    max-width: 100%;
  }
  
  .message-window {
    width: 95%;
    padding: 25px;
  }
}

@media (max-width: 360px) {
  html {
    font-size: 10px;
  }
  
  .subject-item {
    padding: 12px;
  }
  
  .subject-image, .subject-icon {
    width: 55px;
    height: 55px;
  }
  
  .subject-icon {
    font-size: 24px;
  }
}

/* تحسينات إضافية */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}