/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, sans-serif;
}

body {
  background: #f9fafb;
  color: #222;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* ================= HEADER ================= */

.header {
  background: #ffffff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
}

.logo {
  font-weight: bold;
  font-size: 22px;
  color: #e546c0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav a {
  text-decoration: none;
  color: #444;
  padding: 8px 12px;
  border-radius: 6px;
  transition: 0.2s;
}

.nav a:hover {
  background: #da46e5;
  color: #fff;
}

/* ================= BUTTONS ================= */

.btn {
  padding: 10px 22px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}

.btn.primary {
  background: linear-gradient(135deg, #8e2de2, #c471ed);
  color: #fff;
  box-shadow: 0 5px 15px rgba(142, 45, 226, 0.4);
  border: none;
}

.btn.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(142, 45, 226, 0.6);
}

.secondary {
  background: #e0e7ff;
  color: #4f46e5;
}

.secondary:hover {
  background: #c7d2fe;
}

/* ================= HERO ================= */

.hero {
  padding: 80px 0;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-size: 42px;
  margin-bottom: 20px;
}

.hero p {
  font-size: 18px;
  color: #555;
  margin-bottom: 30px;
}

.hero-image img {
  width: 100%;
  border-radius: 10px;
}



/* ================= DASHBOARD ================= */

.student-dashboard .container {
  padding: 40px 0;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

.card {
  background: #fff;
  padding: 40px 20px;
  text-align: center;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  transition: 0.3s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.card img {
  width: 80px;
  margin-bottom: 20px;
}

.card h3 {
  font-size: 22px;
  color: #4f46e5;
  margin-bottom: 10px;
}

.card p {
  font-size: 16px;
  color: #555;
}

/* ================= COURSE PAGE ================= */

.course-page {
  padding: 50px 0;
}

.main-video video {
  width: 100%;
  border-radius: 15px;
}

.video-list {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.video-item {
  padding: 15px;
  background: #f2f2f2;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
}

.video-item:hover {
  background: #8e44ad;
  color: white;
}

/* ================= MODAL ================= */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-content {
  background: #fff;
  width: 90%;
  max-width: 400px;
  padding: 30px;
  border-radius: 12px;
  position: relative;
}

.modal-content input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

/* Fix login button visibility - highest specificity */
#loginForm button[type="submit"] {
  width: 100% !important;
  padding: 12px !important;
  border: none !important;
  border-radius: 25px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  background: linear-gradient(135deg, #8e2de2, #c471ed) !important;
  color: #fff !important;
  font-size: 16px !important;
  margin-top: 10px !important;
}

#loginForm button[type="submit"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(142, 45, 226, 0.4) !important;
}


.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
}

/* ================= DROPDOWN ================= */

.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: 120%;
  left: 0;
  background: #fff;
  width: 260px;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 15px 30px rgba(0,0,0,.12);
  display: none;
}

.dropdown-menu.show {
  display: block;
}

/* ================= RESPONSIVE ================= */

.hamburger {
  display: none;
  font-size: 28px;
  cursor: pointer;
  color: #4f46e5;
}

@media (max-width: 768px) {
  .hero-content,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .hamburger {
    display: block;
  }

  .nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 10px;
  }

  .nav.active {
    display: flex;
  }
}
/* Courses Grid */
.courses-grid {
  padding: 60px 0;
  background: #f8fafc;
}

.courses-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.course-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  cursor: pointer;
}

.course-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(142, 45, 226, 0.15);
}

.course-image {
  height: 180px;
  background: linear-gradient(135deg, #8e2de2, #c471ed);
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-image {
  height: 200px;  /* Taller image container */
  position: relative;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}

.course-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;  /* Perfectly fills container */
  object-position: center;
  transition: transform 0.4s ease;
}

.course-card:hover .course-image img {
  transform: scale(1.05);  /* Zoom effect on hover */
}
.course-info {
  padding: 30px;
}

.course-info h3 {
  font-size: 24px;
  color: #1e293b;
  margin-bottom: 12px;
}

.course-info p {
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 20px;
}

.course-meta {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #94a3b8;
}

@media (max-width: 768px) {
  .courses-container {
    grid-template-columns: 1fr;
  }
}
/* Back Button */
.back-section {
  background: #f8fafc;
  padding: 20px 0;
  border-bottom: 1px solid #e2e8f0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #8e2de2, #c471ed);
  color: white !important;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(142, 45, 226, 0.3);
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(142, 45, 226, 0.4);
  text-decoration: none;
  color: white !important;
}
/* Books Grid - نفس الديزاين القديم + حجم أصغر */
.books-grid {
  padding: 40px 0;
  background: #f8fafc;
}

.books-category {
  margin-bottom: 40px;
}

.books-category h2 {
  font-size: 24px;
  color: #1e293b;
  margin-bottom: 25px;
  text-align: center;
}

.books-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.book-card {
  background: #fff;
  padding: 25px;  /* نفس الـ card padding القديم */
  text-align: center;
  border-radius: 12px;  /* نفس الـ card radius */
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);  /* نفس الـ shadow */
  transition: 0.3s;
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-5px);  /* نفس الـ hover effect القديم */
  box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.book-cover {
  width: 80px;
  height: 100px;
  margin: 0 auto 15px;
  border-radius: 8px;
  overflow: hidden;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-info h3 {
  font-size: 18px;
  color: #4f46e5;  /* نفس لون h3 في الـ cards القديمة */
  margin-bottom: 10px;
}

.book-info p {
  font-size: 14px;  /* أصغر شوية */
  color: #555;
  margin-bottom: 15px;
}

.book-size {
  display: block;
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 15px;
}

.download-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #8e2de2, #c471ed);  /* نفس gradient الأزرار */
  color: white;
  border: none;
  border-radius: 25px;  /* نفس الـ btn radius */
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: 0.3s;
}

.download-btn:hover {
  transform: translateY(-2px);  /* نفس الـ hover */
  box-shadow: 0 8px 20px rgba(142, 45, 226, 0.6);
}















/* Enhanced Mobile Typography & Spacing */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; line-height: 1.2; } /* Scales from 42px */
  .hero p { font-size: 1.1rem; }
  .modal-content { margin: 20px; padding: 25px; } /* Better padding on phones */
  .nav a { padding: 12px 16px; } /* Larger touch targets */
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-content { gap: 30px; }
  .container { max-width: 95%; }
}

/* Prevent horizontal scroll */
html { overflow-x: hidden; }


.btn-login {
  display: inline-block;
  margin-top: 20px;
  padding: 14px 30px;
  background: linear-gradient(135deg, #8e2de2, #c471ed);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(142, 45, 226, 0.3);
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(142, 45, 226, 0.4);
  color: white;
  text-decoration: none;
}






/* Courses Hero Enhancement */
.courses-hero {
  padding: 100px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: relative;
  overflow: hidden;
}
.courses-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1.5" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}
.courses-hero .hero-text h1 { font-size: 48px; margin-bottom: 15px; color: white; }
.courses-hero .hero-text p { font-size: 20px; opacity: 0.95; }

/* Search Bar */
.search-bar { display: flex; gap: 15px; max-width: 500px; margin-top: 30px; }
.search-input { flex: 1; padding: 16px 20px; border: none; border-radius: 50px; font-size: 16px; }
.search-btn { padding: 16px 30px; background: rgba(255,255,255,0.2); color: white; border: none; border-radius: 50px; font-weight: 600; cursor: pointer; backdrop-filter: blur(10px); }
.search-btn:hover { background: rgba(255,255,255,0.3); }

/* Enhanced Course Cards */
.course-card { position: relative; }
.course-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #10b981;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}
.course-progress {
  margin-top: 20px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #8e2de2, #c471ed);
  color: white;
  border-radius: 25px;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
.course-card:hover .course-progress { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(142,45,226,0.4); }

/* Empty State */
.empty-state { text-align: center; padding: 80px 20px; color: #64748b; }
.empty-icon { font-size: 80px; margin-bottom: 20px; }
.empty-state h2 { color: #1e293b; margin-bottom: 10px; font-size: 28px; }

/* Responsive */
@media (max-width: 768px) {
  .courses-hero .hero-text h1 { font-size: 36px; }
  .search-bar { flex-direction: column; }
  .courses-hero { padding: 80px 0; }
}


/* =================== */
/* ENHANCEMENTS - User Frontend Polish */
/* =================== */

/* Smooth page load */
body {
  animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Enhanced header with shadow on scroll */
.header {
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Better button hover effects */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

.btn::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;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn.primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(142, 45, 226, 0.7);
}

.btn.secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

/* Enhanced hero section */
.hero {
  animation: slideInUp 0.8s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-image img {
  transition: transform 0.5s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.hero:hover .hero-image img {
  transform: scale(1.05);
}

/* Enhanced cards with better hover */
.card,
.course-card,
.book-card {
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}

.card::before,
.course-card::before,
.book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #8e2de2, #c471ed);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.card:hover::before,
.course-card:hover::before,
.book-card:hover::before {
  transform: scaleX(1);
}

.card:hover,
.course-card:hover,
.book-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 25px 50px rgba(142, 45, 226, 0.25);
}

/* Better course/book image hover */
.course-image,
.book-cover {
  overflow: hidden;
  position: relative;
}

.course-image img,
.book-cover img {
  transition: transform 0.5s ease;
}

.course-card:hover .course-image img,
.book-card:hover .book-cover img {
  transform: scale(1.15);
}

/* Enhanced modal */
.modal {
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  animation: slideDown 0.4s ease-out;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content input {
  transition: all 0.3s ease;
}

/* Enhanced navigation */
.nav a {
  position: relative;
  transition: all 0.3s ease;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #8e2de2, #c471ed);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.nav a:hover::after {
  width: 80%;
}

/* Enhanced dropdown */
.dropdown-menu {
  animation: dropDown 0.4s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

@keyframes dropDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Better back button */
.back-btn {
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

.back-btn:hover {
  transform: translateX(-5px);
  box-shadow: 0 10px 30px rgba(142, 45, 226, 0.5);
}


/* Smooth scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #8e2de2, #c471ed);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #7a24d1, #b55edc);
}

/* Loading states */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Enhanced course meta */
.course-meta span,
.book-size {
  transition: color 0.3s ease;
}

.course-card:hover .course-meta span,
.book-card:hover .book-size {
  color: #8e2de2;
}

/* Better typography */
h1, h2, h3 {
  text-rendering: optimizeLegibility;
}

/* Responsive enhancements */
@media (max-width: 768px) {
  .hero-content {
    animation-duration: 1s;
  }
  
  .card:hover,
  .course-card:hover,
  .book-card:hover {
    transform: translateY(-5px) scale(1.01);
  }
  

}



