 * {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
 }

 :root {
   --primary-color: #f5a623;
   --secondary-color: #2c5f7b;
   --accent-color: #4a90a4;
   --dark-blue: #1a4d5c;
   --light-gray: #f8f9fa;
   --white: #ffffff;
   --text-dark: #2d3436;
   --text-light: #636e72;
   --success: #00b894;
   --danger: #e17055;
   --shadow: 0 4px 15px rgba(44, 95, 123, 0.1);
   --gradient: linear-gradient(135deg, #2c5f7b 0%, #4a90a4 100%);
   --hover-transform: translateY(-3px);
 }

 body {
   font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
   line-height: 1.6;
   color: var(--text-dark);
   background: var(--gradient);
   min-height: 100vh;
   overflow-x: hidden;
 }

 /* Animated Background */
 .animated-bg {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   z-index: -1;
   background: var(--gradient);
 }

 .animated-bg::before {
   content: '';
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="%23f5a623" opacity="0.3"><animate attributeName="opacity" values="0.3;0.8;0.3" dur="3s" repeatCount="indefinite"/></circle><circle cx="80" cy="30" r="1.5" fill="%23ffffff" opacity="0.4"><animate attributeName="opacity" values="0.4;0.9;0.4" dur="4s" repeatCount="indefinite"/></circle><circle cx="40" cy="70" r="2.5" fill="%23f5a623" opacity="0.2"><animate attributeName="opacity" values="0.2;0.7;0.2" dur="5s" repeatCount="indefinite"/></circle></svg>') repeat;
   animation: float 20s ease-in-out infinite;
 }

 @keyframes float {

   0%,
   100% {
     transform: translateY(0px) rotate(0deg);
   }

   50% {
     transform: translateY(-20px) rotate(180deg);
   }
 }

 /* Logo */
 .logo {
   display: flex;
   align-items: center;
   justify-content: center;
   margin-bottom: 2rem;
   animation: logoGlow 2s ease-in-out infinite alternate;
 }

 @keyframes logoGlow {
   from {
     filter: drop-shadow(0 0 5px rgba(245, 166, 35, 0.3));
   }

   to {
     filter: drop-shadow(0 0 20px rgba(245, 166, 35, 0.6));
   }
 }

 .logo-icon {
   width: 120px;
   height: 120px;
   background: var(--primary-color);
   border-radius: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
   margin-left: 1rem;
   box-shadow: var(--shadow);
   position: relative;
   overflow: hidden;
 }

 .logo-icon::before {
   content: '';
   position: absolute;
   top: -50%;
   left: -50%;
   width: 200%;
   height: 200%;
   background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
   transform: rotate(45deg);
   animation: shine 3s ease-in-out infinite;
 }

 @keyframes shine {
   0% {
     transform: translateX(-100%) translateY(-100%) rotate(45deg);
   }

   50% {
     transform: translateX(100%) translateY(100%) rotate(45deg);
   }

   100% {
     transform: translateX(-100%) translateY(-100%) rotate(45deg);
   }
 }

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* makes the image fill while keeping aspect ratio */
  border-radius: 50%; /* keeps it circular */
  z-index: 2;
}


 .logo-text {
   font-size: 2.5rem;
   font-weight: bold;
   color: var(--white);
   text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
 }

 /* Container */
 .container {
   max-width: 1200px;
   margin: 0 auto;
   padding: 2rem;
   position: relative;
 }

 /* Cards */
 .card {
   background: var(--white);
   border-radius: 20px;
   padding: 2.5rem;
   box-shadow: var(--shadow);
   margin-bottom: 2rem;
   position: relative;
   overflow: hidden;
   transition: all 0.3s ease;
 }

 .card::before {
   content: '';
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 4px;
   background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
 }

 .card:hover {
   transform: var(--hover-transform);
   box-shadow: 0 8px 30px rgba(44, 95, 123, 0.15);
 }

 /* Registration Form */
 .register-form {
   max-width: 500px;
   margin: 2rem auto;
 }

 .form-group {
   margin-bottom: 1.5rem;
   position: relative;
 }

 .form-label {
   display: block;
   margin-bottom: 0.5rem;
   font-weight: 600;
   color: var(--text-dark);
   transition: all 0.3s ease;
 }

 .form-control {
   width: 100%;
   padding: 1rem 1.5rem;
   border: 2px solid #e9ecef;
   border-radius: 12px;
   font-size: 1rem;
   transition: all 0.3s ease;
   background: var(--light-gray);
 }

 .form-control:focus {
   outline: none;
   border-color: var(--primary-color);
   box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
   transform: translateY(-2px);
 }

 .form-control:focus+.form-label {
   color: var(--primary-color);
 }

 .btn {
   display: inline-block;
   padding: 1rem 2rem;
   border: none;
   border-radius: 12px;
   font-size: 1.1rem;
   font-weight: 600;
   text-decoration: none;
   text-align: center;
   cursor: pointer;
   transition: all 0.3s ease;
   position: relative;
   overflow: hidden;
 }

 .btn-primary {
   background: var(--primary-color);
   color: var(--white);
   width: 100%;
 }

 .btn-primary:hover {
   background: #e6951e;
   transform: var(--hover-transform);
   box-shadow: 0 8px 25px rgba(245, 166, 35, 0.3);
 }

 .btn-primary::before {
   content: '';
   position: absolute;
   top: 50%;
   left: 50%;
   width: 0;
   height: 0;
   background: rgba(255, 255, 255, 0.2);
   border-radius: 50%;
   transform: translate(-50%, -50%);
   transition: all 0.5s ease;
 }

 .btn-primary:active::before {
   width: 300px;
   height: 300px;
 }

 /* Dashboard */
 .dashboard {
   display: none;
 }

 .welcome-section {
   text-align: center;
   margin-bottom: 3rem;
 }

 .welcome-title {
   font-size: 2.5rem;
   color: var(--white);
   margin-bottom: 1rem;
   text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
 }

 .welcome-subtitle {
   font-size: 1.2rem;
   color: rgba(255, 255, 255, 0.9);
   margin-bottom: 2rem;
 }

 .user-info {
   background: rgba(255, 255, 255, 0.1);
   padding: 1rem 2rem;
   border-radius: 50px;
   display: inline-block;
   backdrop-filter: blur(10px);
   border: 1px solid rgba(255, 255, 255, 0.2);
 }

 /* Categories Grid */
 .categories-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
   gap: 2rem;
   margin-top: 2rem;
 }

 .category-card {
   background: var(--white);
   border-radius: 20px;
   padding: 2rem;
   text-align: center;
   cursor: pointer;
   transition: all 0.3s ease;
   position: relative;
   overflow: hidden;
 }

 .category-card::before {
   content: '';
   position: absolute;
   top: 0;
   left: -100%;
   width: 100%;
   height: 100%;
   background: linear-gradient(90deg, transparent, rgba(245, 166, 35, 0.1), transparent);
   transition: all 0.5s ease;
 }

 .category-card:hover::before {
   left: 100%;
 }

 .category-card:hover {
   transform: var(--hover-transform);
   box-shadow: 0 10px 30px rgba(44, 95, 123, 0.15);
 }

 .category-icon {
   width: 80px;
   height: 80px;
   margin: 0 auto 1rem;
   border-radius: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 2rem;
   color: var(--white);
   position: relative;
 }

 .category-icon.exams {
   background: linear-gradient(135deg, #e17055, #d63031);
 }

 .category-icon.files {
   background: linear-gradient(135deg, #0984e3, #74b9ff);
 }

 .category-icon.lessons {
   background: linear-gradient(135deg, #00b894, #00cec9);
 }

 .category-title {
   font-size: 1.5rem;
   font-weight: bold;
   margin-bottom: 0.5rem;
   color: var(--text-dark);
 }

 .category-description {
   color: var(--text-light);
   font-size: 0.95rem;
 }

 /* Subcategories */
 .subcategories {
   display: none;
   margin-top: 2rem;
 }

 .subcategory-item {
   background: var(--light-gray);
   border: 2px solid transparent;
   border-radius: 15px;
   padding: 1.5rem;
   margin-bottom: 1rem;
   cursor: pointer;
   transition: all 0.3s ease;
   display: flex;
   align-items: center;
   justify-content: space-between;
 }

 .subcategory-item:hover {
   border-color: var(--primary-color);
   background: var(--white);
   transform: translateX(10px);
 }

 .subcategory-content {
   display: flex;
   align-items: center;
 }

 .subcategory-icon {
   width: 50px;
   height: 50px;
   border-radius: 12px;
   background: var(--primary-color);
   display: flex;
   align-items: center;
   justify-content: center;
   color: var(--white);
   margin-left: 1rem;
   font-size: 1.2rem;
 }

 .subcategory-text {
   font-weight: 600;
   color: var(--text-dark);
   font-size: 1.1rem;
 }

 .subcategory-arrow {
   color: var(--text-light);
   font-size: 1.2rem;
   transition: all 0.3s ease;
 }

 .subcategory-item:hover .subcategory-arrow {
   color: var(--primary-color);
   transform: translateX(5px);
 }

 /* Back Button */
 .back-btn {
   background: rgba(255, 255, 255, 0.2);
   color: var(--white);
   border: 2px solid rgba(255, 255, 255, 0.3);
   padding: 0.8rem 1.5rem;
   border-radius: 12px;
   cursor: pointer;
   transition: all 0.3s ease;
   backdrop-filter: blur(10px);
   margin-bottom: 2rem;
   display: inline-flex;
   align-items: center;
   gap: 0.5rem;
 }

 .back-btn:hover {
   background: rgba(255, 255, 255, 0.3);
   transform: var(--hover-transform);
 }

 /* Content Lists */
 .content-list {
   display: none;
 }

 .content-item {
   background: var(--white);
   border-radius: 15px;
   padding: 1.5rem;
   margin-bottom: 1.5rem;
   box-shadow: var(--shadow);
   transition: all 0.3s ease;
   border-right: 4px solid var(--primary-color);
 }

 .content-item:hover {
   transform: var(--hover-transform);
   box-shadow: 0 8px 25px rgba(44, 95, 123, 0.15);
 }

 .content-header {
   display: flex;
   align-items: center;
   justify-content: space-between;
   margin-bottom: 1rem;
 }

 .content-title {
   font-size: 1.3rem;
   font-weight: bold;
   color: var(--text-dark);
   margin: 0;
 }

 .content-meta {
   display: flex;
   align-items: center;
   gap: 1rem;
   color: var(--text-light);
   font-size: 0.9rem;
 }

 .content-actions {
   display: flex;
   gap: 0.5rem;
   margin-top: 1rem;
 }

 .btn-action {
   padding: 0.5rem 1rem;
   border-radius: 8px;
   font-size: 0.9rem;
   text-decoration: none;
   transition: all 0.3s ease;
 }

 .btn-exam {
   background: #e17055;
   color: var(--white);
 }

 .btn-download {
   background: #0984e3;
   color: var(--white);
 }

 .btn-watch {
   background: #00b894;
   color: var(--white);
 }

 .btn-action:hover {
   transform: var(--hover-transform);
   filter: brightness(1.1);
 }

 /* Responsive */
 @media (max-width: 768px) {
   .container {
     padding: 1rem;
   }

   .logo-text {
     font-size: 2rem;
   }

   .welcome-title {
     font-size: 2rem;
   }

   .categories-grid {
     grid-template-columns: 1fr;
   }

   .subcategory-item:hover {
     transform: none;
   }

   .content-header {
     flex-direction: column;
     align-items: flex-start;
   }

   .content-actions {
     flex-wrap: wrap;
   }
 }

 /* Loading Animation */
 .loading {
   display: none;
   text-align: center;
   color: var(--white);
   margin: 2rem 0;
 }

 .spinner {
   width: 40px;
   height: 40px;
   border: 4px solid rgba(255, 255, 255, 0.3);
   border-top: 4px solid var(--white);
   border-radius: 50%;
   animation: spin 1s linear infinite;
   margin: 0 auto 1rem;
 }

 @keyframes spin {
   0% {
     transform: rotate(0deg);
   }

   100% {
     transform: rotate(360deg);
   }
 }

 /* Success Animation */
 .success-checkmark {
   width: 80px;
   height: 80px;
   border-radius: 50%;
   display: block;
   stroke-width: 2;
   stroke: var(--success);
   stroke-miterlimit: 10;
   margin: 10px auto;
   box-shadow: inset 0px 0px 0px var(--success);
   animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
 }

 .success-checkmark-circle {
   stroke-dasharray: 166;
   stroke-dashoffset: 166;
   stroke-width: 2;
   stroke-miterlimit: 10;
   stroke: var(--success);
   fill: none;
   animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
 }

 .success-checkmark-check {
   transform-origin: 50% 50%;
   stroke-dasharray: 48;
   stroke-dashoffset: 48;
   animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
 }

 @keyframes stroke {
   100% {
     stroke-dashoffset: 0;
   }
 }

 @keyframes scale {

   0%,
   100% {
     transform: none;
   }

   50% {
     transform: scale3d(1.1, 1.1, 1);
   }
 }

 @keyframes fill {
   100% {
     box-shadow: inset 0px 0px 0px 30px var(--success);
   }
 }

 /* Add this to your existing CSS file */

/* Subcategory Cards */
.subcategories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.subcategory-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

/* Hover effects for all subcategory cards */
.subcategory-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Special styling for clickable final categories */
a.subcategory-card {
  text-decoration: none !important;
  color: inherit !important;
}

a.subcategory-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Shimmer effect for clickable final categories */
a.subcategory-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(40, 167, 69, 0.1), transparent);
  transition: all 0.6s ease;
}

a.subcategory-card:hover::before {
  left: 100%;
}

.subcategory-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.subcategory-icon i {
  color: var(--primary-color, #f39c12);
  transition: all 0.3s ease;
}

/* Special icon color for final categories */
a.subcategory-card .subcategory-icon i {
  color: #28a745;
}

a.subcategory-card:hover .subcategory-icon i {
  transform: scale(1.1);
  filter: drop-shadow(0 0 10px rgba(40, 167, 69, 0.3));
}

.subcategory-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-dark, #2d3436);
  margin: 0 0 0.5rem 0;
  transition: all 0.3s ease;
}

a.subcategory-card:hover .subcategory-title {
  color: #28a745;
}

/* Pulse animation for final categories */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
  }
}

a.subcategory-card {
  animation: pulse 3s infinite;
}

/* Ready indicator */
.subcategory-card p {
  margin: 0;
  transition: all 0.3s ease;
}

a.subcategory-card:hover p {
  transform: scale(1.05);
  text-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .subcategories-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .subcategory-card {
    padding: 1.5rem;
  }
  
  .subcategory-icon {
    font-size: 2rem;
  }
  
  .subcategory-title {
    font-size: 1.1rem;
  }
}


/* Add this CSS to your existing style.css file */

/* Files Section Styles */
.files-section {
  padding: 2rem;
  display: none;
}

.section-title {
  text-align: center;
  color: white;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.file-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.file-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.file-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f39c12, #e67e22);
}

.file-icon {
  text-align: center;
  margin-bottom: 1rem;
}

.file-icon i {
  font-size: 3rem;
  color: #e74c3c;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

.file-info {
  margin-bottom: 1.5rem;
}

.file-name {
  font-size: 1.2rem;
  font-weight: bold;
  color: #2d3436;
  margin: 0 0 1rem 0;
  text-align: center;
  line-height: 1.4;
}

.file-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #636e72;
}

.file-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-meta i {
  width: 16px;
  color: #f39c12;
}

.file-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.btn-file-action {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn-view {
  background: linear-gradient(135deg, #0984e3, #74b9ff);
  color: white;
}

.btn-view:hover {
  background: linear-gradient(135deg, #0770c1, #5ca0fc);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(9, 132, 227, 0.3);
}

.btn-download {
  background: linear-gradient(135deg, #00b894, #00cec9);
  color: white;
}

.btn-download:hover {
  background: linear-gradient(135deg, #009a7a, #00b8b3);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 184, 148, 0.3);
}

.btn-file-action::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.5s ease;
}

.btn-file-action:active::before {
  width: 200px;
  height: 200px;
}

/* Animation for file cards */
.file-card {
  opacity: 0;
  transform: translateY(30px);
  animation: slideInUp 0.6s ease forwards;
}

.file-card:nth-child(1) { animation-delay: 0.1s; }
.file-card:nth-child(2) { animation-delay: 0.2s; }
.file-card:nth-child(3) { animation-delay: 0.3s; }
.file-card:nth-child(4) { animation-delay: 0.4s; }
.file-card:nth-child(5) { animation-delay: 0.5s; }
.file-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading state for files */
.files-loading {
  text-align: center;
  color: white;
  padding: 3rem;
}

.files-loading .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #f39c12;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

/* Responsive design for files */
@media (max-width: 768px) {
  .files-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1rem;
  }
  
  .file-card {
    padding: 1.25rem;
  }
  
  .file-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .btn-file-action {
    flex: none;
  }
  
  .section-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .files-section {
    padding: 1rem;
  }
  
  .file-name {
    font-size: 1.1rem;
  }
  
  .file-meta {
    font-size: 0.85rem;
  }
  
  .btn-file-action {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
  }
}

/* Add this CSS to your existing style.css file */

/* Lessons Section Styles */
.lessons-section {
  padding: 2rem;
  display: none;
}

.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.lesson-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
}

.lesson-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.lesson-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #27ae60, #2ecc71);
  z-index: 2;
}

/* Lesson Thumbnail */
.lesson-thumbnail {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #f8f9fa;
}

.thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.lesson-card:hover .thumbnail-image {
  transform: scale(1.05);
}

.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(231, 76, 60, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.lesson-card:hover .play-overlay {
  background: #e74c3c;
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
}

.invalid-video {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #e74c3c;
  font-size: 0.9rem;
}

.invalid-video i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Lesson Info */
.lesson-info {
  padding: 1.5rem;
}

.lesson-name {
  font-size: 1.2rem;
  font-weight: bold;
  color: #2d3436;
  margin: 0 0 1rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lesson-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  color: #636e72;
  margin-bottom: 1rem;
}

.lesson-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lesson-meta i {
  width: 16px;
  color: #27ae60;
}

/* Lesson Actions */
.lesson-actions {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  gap: 0.75rem;
}

.btn-lesson-action {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn-watch {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
}

.btn-watch:hover {
  background: linear-gradient(135deg, #229954, #27ae60);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(39, 174, 96, 0.3);
}

.btn-youtube {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
}

.btn-youtube:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
}

.btn-disabled {
  background: #bdc3c7;
  color: #7f8c8d;
  cursor: not-allowed;
}

.btn-lesson-action::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.5s ease;
}

.btn-lesson-action:active:not(.btn-disabled)::before {
  width: 200px;
  height: 200px;
}

/* Video Modal */
.video-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.video-modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.video-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #2d3436;
  color: white;
}

.video-modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.video-modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.video-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

.video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Animation for lesson cards */
.lesson-card {
  opacity: 0;
  transform: translateY(30px);
  animation: slideInUp 0.6s ease forwards;
}

.lesson-card:nth-child(1) { animation-delay: 0.1s; }
.lesson-card:nth-child(2) { animation-delay: 0.2s; }
.lesson-card:nth-child(3) { animation-delay: 0.3s; }
.lesson-card:nth-child(4) { animation-delay: 0.4s; }
.lesson-card:nth-child(5) { animation-delay: 0.5s; }
.lesson-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive design for lessons */
@media (max-width: 768px) {
  .lessons-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1rem;
  }
  
  .lesson-card {
    margin-bottom: 1rem;
  }
  
  .lesson-thumbnail {
    height: 200px;
  }
  
  .lesson-info {
    padding: 1.25rem;
  }
  
  .lesson-actions {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1.25rem 1.25rem;
  }
  
  .btn-lesson-action {
    flex: none;
  }
  
  .video-modal-content {
    width: 95%;
    margin: 1rem;
  }
  
  .video-modal-header {
    padding: 0.75rem 1rem;
  }
  
  .video-modal-header h3 {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .lessons-section {
    padding: 1rem;
  }
  
  .lesson-thumbnail {
    height: 160px;
  }
  
  .lesson-name {
    font-size: 1.1rem;
  }
  
  .lesson-meta {
    font-size: 0.85rem;
  }
  
  .btn-lesson-action {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
  }
}

/* Add this comprehensive exam CSS to your existing style.css file */
/* ====================================================
   EXAM SYSTEM STYLES - MATCHING YOUR EXISTING DESIGN
   ==================================================== */

/* Exams Section - Matching your files and lessons sections */


.exams-section {
  padding: 2rem;
  display: none;
}

.exams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.exam-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  animation: slideInUp 0.6s ease forwards;
}

.exam-card:nth-child(1) { animation-delay: 0.1s; }
.exam-card:nth-child(2) { animation-delay: 0.2s; }
.exam-card:nth-child(3) { animation-delay: 0.3s; }
.exam-card:nth-child(4) { animation-delay: 0.4s; }
.exam-card:nth-child(5) { animation-delay: 0.5s; }
.exam-card:nth-child(6) { animation-delay: 0.6s; }

.exam-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.exam-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* Exam Card Header */
.exam-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.exam-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.4;
  flex: 1;
  margin-left: 1rem;
}

.exam-status-badge {
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-available {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #155724;
}

.status-upcoming {
  background: linear-gradient(135deg, #fff3cd, #ffeeba);
  color: #856404;
}

.status-expired {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  color: #721c24;
}

.status-inactive {
  background: linear-gradient(135deg, #e2e3e5, #d6d8db);
  color: #495057;
}

/* Exam Description */
.exam-description {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Exam Stats - Similar to your file meta */
.exam-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-item {
  background: var(--light-gray);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: var(--white);
  transform: var(--hover-transform);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  color: var(--white);
  font-size: 1.1rem;
}

.stat-icon.questions { 
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
}
.stat-icon.duration { 
  background: linear-gradient(135deg, var(--danger), #c0392b);
}
.stat-icon.attempts { 
  background: linear-gradient(135deg, var(--primary-color), #e67e22);
}
.stat-icon.grade { 
  background: linear-gradient(135deg, var(--success), #27ae60);
}

.stat-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Exam Progress */
.exam-progress {
  margin-bottom: 1.5rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.attempts-info {
  font-size: 0.9rem;
  color: var(--text-light);
}

.best-score {
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  color: var(--white);
  font-size: 0.8rem;
}

.progress-bar {
  height: 8px;
  background: #e9ecef;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
  border-radius: 20px;
  transition: width 1s ease-in-out;
}

/* Exam Actions - Following your button styles */
.exam-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-exam {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), #e67e22);
  color: var(--white);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #e67e22, var(--primary-color));
  transform: var(--hover-transform);
  box-shadow: 0 8px 25px rgba(245, 166, 35, 0.3);
}

.btn-continue {
  background: linear-gradient(135deg, var(--success), #27ae60);
  color: var(--white);
}

.btn-continue:hover {
  background: linear-gradient(135deg, #27ae60, var(--success));
  transform: var(--hover-transform);
  box-shadow: 0 8px 25px rgba(0, 184, 148, 0.3);
}

.btn-disabled {
  background: #bdc3c7;
  color: #7f8c8d;
  cursor: not-allowed;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--text-light), var(--text-dark));
  color: var(--white);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, var(--text-dark), var(--text-light));
  transform: var(--hover-transform);
}

/* Active attempt indicator */
.active-attempt {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 15px;
  height: 15px;
  background: var(--danger);
  border-radius: 50%;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

/* Exam Details Page */
.exam-details-section {
  padding: 2rem;
  min-height: 100vh;
}

.exam-details-container {
  max-width: 1000px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.exam-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #e9ecef;
}

.exam-details-section .exam-title {
  font-size: 2.5rem;
  color: var(--text-dark);
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.exam-description {
  background: var(--light-gray);
  padding: 1.5rem;
  border-radius: 15px;
  margin-bottom: 2rem;
  border-right: 4px solid var(--primary-color);
  line-height: 1.6;
}

.exam-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.info-card {
  background: var(--light-gray);
  border-radius: 15px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.info-card:hover {
  background: var(--white);
  transform: var(--hover-transform);
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

.info-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.5rem;
  box-shadow: var(--shadow);
}

.info-content h3 {
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.info-content p {
  color: var(--text-light);
  font-size: 1.1rem;
  font-weight: 500;
}

/* Exam Instructions */
.exam-instructions {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-radius: 15px;
  padding: 2rem;
  margin: 2rem 0;
  border: 2px solid var(--secondary-color);
}

.exam-instructions h3 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.instructions-content {
  line-height: 1.6;
}

.instructions-content ul {
  list-style: none;
  padding: 0;
}

.instructions-content li {
  margin: 0.5rem 0;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(44, 95, 123, 0.2);
  position: relative;
  padding-right: 2rem;
}

.instructions-content li::before {
  content: '✓';
  position: absolute;
  right: 0;
  top: 0.5rem;
  color: var(--success);
  font-weight: bold;
}

/* Start Exam Button */
.btn-start-exam {
  background: linear-gradient(135deg, var(--success), #27ae60);
  color: var(--white);
  border: none;
  padding: 1.5rem 3rem;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 184, 148, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-start-exam:hover {
  background: linear-gradient(135deg, #27ae60, var(--success));
  transform: var(--hover-transform);
  box-shadow: 0 15px 40px rgba(0, 184, 148, 0.6);
}

/* Exam Taking Page */
.exam-taking-section {
  padding: 1rem;
  min-height: 100vh;
  background: var(--gradient);
}

.exam-header-bar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 15px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 1rem;
  z-index: 100;
}

.exam-info h2 {
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.question-progress {
  color: var(--text-light);
  font-size: 0.9rem;
}

.progress-bar {
  width: 200px;
  height: 6px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.timer-display {
  background: linear-gradient(135deg, var(--danger), #c0392b);
  color: var(--white);
  padding: 1rem 1.5rem;
  border-radius: 25px;
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow);
}

.timer-warning-active {
  background: linear-gradient(135deg, var(--primary-color), #e67e22);
  animation: timerPulse 1s infinite;
}

@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Question Container */
.question-container {
  max-width: 900px;
  margin: 0 auto 2rem;
}

.question-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.question-type {
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.question-grade {
  background: linear-gradient(135deg, var(--success), #27ae60);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-weight: 600;
}

.question-text {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-dark);
  margin-bottom: 2rem;
  font-weight: 500;
}

/* Question Types */
.question-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.option-label {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--light-gray);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.option-label:hover {
  background: var(--white);
  transform: translateX(-5px);
}

.option-input {
  display: none;
}

.option-input:checked + .option-content {
  color: var(--primary-color);
}

.option-input:checked + .option-content .option-letter {
  background: var(--primary-color);
  color: var(--white);
}

.option-label:has(.option-input:checked) {
  background: rgba(245, 166, 35, 0.1);
  border-color: var(--primary-color);
}

.option-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.option-letter {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #dee2e6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.option-text {
  flex: 1;
  font-size: 1rem;
}

/* Essay and Fill Blank Inputs */
.essay-textarea, .fill-blank-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.essay-textarea {
  min-height: 200px;
  resize: vertical;
}

.essay-textarea:focus, .fill-blank-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.fill-blank-input {
  text-align: center;
  font-weight: 500;
}

/* Navigation */
.exam-navigation {
  max-width: 900px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.btn-nav {
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-prev {
  background: linear-gradient(135deg, var(--text-light), var(--text-dark));
  color: var(--white);
}

.btn-next {
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  color: var(--white);
}

.btn-submit {
  background: linear-gradient(135deg, var(--success), #27ae60);
  color: var(--white);
}

.btn-nav:hover {
  transform: var(--hover-transform);
  box-shadow: var(--shadow);
}

/* Question Navigator */
.question-navigator h4 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
  font-size: 1.2rem;
}

.questions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 0.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.question-btn {
  width: 50px;
  height: 50px;
  border: 2px solid #e9ecef;
  background: var(--light-gray);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.question-btn:hover {
  background: var(--white);
  transform: scale(1.1);
}

.question-btn.active {
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  color: var(--white);
  border-color: var(--secondary-color);
}

.question-btn.answered {
  background: linear-gradient(135deg, var(--success), #27ae60);
  color: var(--white);
  border-color: var(--success);
}

/* Responsive Design */
@media (max-width: 768px) {
  .exams-grid, .lessons-grid, .files-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1rem;
  }
  
  .exam-card {
    padding: 1.25rem;
  }
  
  .exam-stats {
    grid-template-columns: 1fr;
  }
  
  .exam-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .progress-info {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .exam-header-bar {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .nav-buttons {
    flex-direction: column;
  }
  
  .questions-grid {
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
  }
}

@media (max-width: 480px) {
  .exam-card {
    padding: 1rem;
  }
  
  .exam-title {
    font-size: 1.1rem;
  }
  
  .btn-exam {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
  }
}
/* Question Image Styling */
.question-image {
  margin: 1.5rem 0;
  text-align: center;
  background: var(--light-gray);
  border-radius: 15px;
  padding: 1rem;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
}

.question-image:hover {
  background: var(--white);
  border-color: var(--primary-color);
  transform: var(--hover-transform);
  box-shadow: var(--shadow);
}

.question-image img {
  max-width: 100%;
  max-height: 400px;
  height: auto;
  width: auto;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  object-fit: contain;
  background: var(--white);
}

.question-image img:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

/* Responsive adjustments for question images */
@media (max-width: 768px) {
  .question-image {
    margin: 1rem 0;
    padding: 0.75rem;
  }
  
  .question-image img {
    max-height: 300px;
  }
}

@media (max-width: 480px) {
  .question-image {
    margin: 0.75rem 0;
    padding: 0.5rem;
  }
  
  .question-image img {
    max-height: 250px;
    border-radius: 8px;
  }
}

/* Exam Modal Styling */
.exam-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: all 0.3s ease;
}

.exam-modal.show {
  opacity: 1;
}

.modal-content {
  background: var(--white);
  border-radius: 20px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.exam-modal.show .modal-content {
  transform: scale(1);
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--white);
  padding: 2rem;
  border-radius: 20px 20px 0 0;
  text-align: center;
  position: relative;
}

.modal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-color), var(--success));
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.modal-header h3::before {
  content: '⚠️';
  font-size: 1.8rem;
}

.modal-body {
  padding: 2rem;
  text-align: center;
  line-height: 1.6;
}

.modal-body p {
  margin: 0 0 1rem 0;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.warning-text {
  color: var(--danger) !important;
  font-weight: 600;
  background: rgba(231, 76, 60, 0.1);
  padding: 1rem;
  border-radius: 10px;
  border-right: 4px solid var(--danger);
  font-size: 1rem !important;
}

.modal-actions {
  padding: 1.5rem 2rem 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  border-top: 1px solid #e9ecef;
}

.btn-cancel, .btn-confirm {
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-cancel {
  background: linear-gradient(135deg, var(--text-light), var(--text-dark));
  color: var(--white);
}

.btn-cancel:hover {
  background: linear-gradient(135deg, var(--text-dark), var(--text-light));
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(108, 117, 125, 0.3);
}

.btn-confirm {
  background: linear-gradient(135deg, var(--danger), #c0392b);
  color: var(--white);
}

.btn-confirm:hover {
  background: linear-gradient(135deg, #c0392b, var(--danger));
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

/* Auto-save Notification */
.auto-save-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, var(--success), #27ae60);
  color: var(--white);
  padding: 1rem 1.5rem;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(0, 184, 148, 0.3);
  display: none;
  z-index: 10000;
  font-weight: 600;
  font-size: 0.9rem;
  animation: slideInRight 0.3s ease;
  backdrop-filter: blur(10px);
}

.auto-save-notification i {
  margin-left: 0.5rem;
  font-size: 1rem;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Timer Critical State */
.timer-critical {
  background: linear-gradient(135deg, var(--danger), #8b0000) !important;
  animation: criticalBlink 0.5s infinite alternate;
}

@keyframes criticalBlink {
  from { opacity: 1; }
  to { opacity: 0.7; }
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 1rem;
  }
  
  .modal-header {
    padding: 1.5rem;
  }
  
  .modal-header h3 {
    font-size: 1.3rem;
  }
  
  .modal-body {
    padding: 1.5rem;
  }
  
  .modal-actions {
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
  }
  
  .btn-cancel, .btn-confirm {
    width: 100%;
    margin: 0;
  }
}

@media (max-width: 480px) {
  .auto-save-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    text-align: center;
    border-radius: 15px;
    padding: 0.75rem 1rem;
  }
}

/* End Exam Style */

.dosyat-button-container {
  text-align: center;
}

.btn-dosyat {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary-color), #e67e22);
  color: var(--white);
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
}

.btn-dosyat:hover {
  transform: var(--hover-transform);
  box-shadow: 0 15px 35px rgba(245, 166, 35, 0.4);
  border-color: rgba(255, 255, 255, 0.3);
}

/* الدوسيات Section */
.dosyat-section {
  padding: 2rem;
  min-height: 100vh;
}

.section-title-container {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2.5rem;
  color: var(--white);
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.section-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto 3rem;
}

.service-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(245, 166, 35, 0.1), transparent);
  transition: all 0.5s ease;
}

.service-card:hover::before {
  left: 100%;
}

.service-card:hover {
  transform: var(--hover-transform);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.service-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 2rem;
  box-shadow: var(--shadow);
}

.service-content {
  flex: 1;
}

.service-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.service-description {
  color: var(--text-light);
  font-size: 1rem;
}

.service-arrow {
  color: var(--primary-color);
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.service-card:hover .service-arrow {
  transform: translateX(-5px);
}

/* Content Sections */
.content-section {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 1.5rem 2rem;
  border-radius: 15px;
  backdrop-filter: blur(10px);
}

.section-header h2 {
  color: var(--white);
  font-size: 2rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-back-to-services {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-back-to-services:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: var(--hover-transform);
}

/* Maktabat Cards */
.maktabat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.maktaba-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  border-right: 4px solid var(--primary-color);
}

.maktaba-card:hover {
  transform: var(--hover-transform);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.maktaba-icon {
  text-align: center;
  margin-bottom: 1.5rem;
}

.maktaba-icon i {
  font-size: 3rem;
  color: var(--primary-color);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.maktaba-info h3 {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 1rem;
  text-align: center;
}

.maktaba-info p {
  color: var(--text-light);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.maktaba-info i {
  color: var(--primary-color);
  width: 16px;
}

.maktaba-actions {
  text-align: center;
  margin-top: 1.5rem;
}

.btn-call {
  background: linear-gradient(135deg, var(--success), #27ae60);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.btn-call:hover {
  transform: var(--hover-transform);
  box-shadow: 0 8px 20px rgba(0, 184, 148, 0.3);
}

/* Delivery Cards */
.delivery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 2rem;
}

.delivery-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  border-right: 4px solid var(--accent-color);
}

.delivery-card:hover {
  transform: var(--hover-transform);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.delivery-icon {
  text-align: center;
  margin-bottom: 1.5rem;
}

.delivery-icon i {
  font-size: 3rem;
  color: var(--accent-color);
}

.delivery-info h3 {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 1rem;
  text-align: center;
}

.delivery-info .phone {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--secondary-color);
  text-align: center;
  margin-bottom: 0.5rem;
}

.delivery-info .description {
  color: var(--text-light);
  text-align: center;
  margin-bottom: 1.5rem;
}

.delivery-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.btn-whatsapp:hover {
  transform: var(--hover-transform);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

/* Books Grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.book-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.book-card:hover {
  transform: var(--hover-transform);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.book-image {
  height: 300px;
  overflow: hidden;
}

.book-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.book-card:hover .book-image img {
  transform: scale(1.1);
}

.book-info {
  padding: 1.5rem;
}

.book-info h3 {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.book-info p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

/* Loading and Error States */
.loading-spinner {
  text-align: center;
  padding: 3rem;
  color: var(--white);
}

.error-message {
  text-align: center;
  color: var(--danger);
  background: rgba(255, 255, 255, 0.9);
  padding: 2rem;
  border-radius: 15px;
  margin: 2rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .services-grid, .maktabat-grid, .delivery-grid, .books-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .service-card {
    padding: 1.5rem;
  }
  
  .section-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .delivery-actions {
    flex-direction: column;
  }
}

/* Detailed Results Section Styling */
.detailed-results {
    margin-top: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.detailed-results h2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: 0;
    padding: 1.5rem 2rem;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detailed-results h2 i {
    font-size: 1.2rem;
}

.questions-review {
    padding: 1rem;
}

.question-review {
    background: #f8f9ff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.question-review:last-child {
    margin-bottom: 0;
}

.question-review.correct {
    border-color: #10b981;
    background: linear-gradient(145deg, #ecfdf5 0%, #f0fdf4 100%);
}

.question-review.incorrect {
    border-color: #ef4444;
    background: linear-gradient(145deg, #fef2f2 0%, #fef7f7 100%);
}

.question-review.ungraded {
    border-color: #f59e0b;
    background: linear-gradient(145deg, #fffbeb 0%, #fefce8 100%);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255,255,255,0.7);
    border-bottom: 1px solid #e5e7eb;
}

.question-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.question-number i.correct {
    color: #10b981;
    font-size: 1.2rem;
}

.question-number i.incorrect {
    color: #ef4444;
    font-size: 1.2rem;
}

.question-number i.pending {
    color: #f59e0b;
    font-size: 1.2rem;
}

.question-grade {
    background: #667eea;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.question-content {
    padding: 1.5rem;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #1f2937;
    margin-bottom: 1.5rem;
    font-weight: 500;
    background: rgba(255,255,255,0.8);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.user-answer {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    position: relative;
}

.user-answer::before {
    content: "👤";
    position: absolute;
    top: -8px;
    right: 15px;
    background: #ffffff;
    padding: 0 8px;
    font-size: 1rem;
}

.user-answer strong {
    color: #4f46e5;
    font-weight: 600;
    font-size: 0.95rem;
}

.correct-answer {
    background: #f0fdf4;
    border: 2px solid #22c55e;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    position: relative;
}

.correct-answer::before {
    content: "✅";
    position: absolute;
    top: -8px;
    right: 15px;
    background: #f0fdf4;
    padding: 0 8px;
    font-size: 1rem;
}

.correct-answer strong {
    color: #16a34a;
    font-weight: 600;
    font-size: 0.95rem;
}

.explanation {
    background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    position: relative;
}

.explanation::before {
    content: "💡";
    position: absolute;
    top: -8px;
    right: 15px;
    background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%);
    padding: 0 8px;
    font-size: 1rem;
}

.explanation strong {
    color: #d97706;
    font-weight: 600;
    font-size: 0.95rem;
}

.no-answer {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.95rem;
}

/* RTL Support */
[dir="rtl"] .question-text {
    border-left: none;
    border-right: 4px solid #667eea;
}

[dir="rtl"] .user-answer::before,
[dir="rtl"] .correct-answer::before,
[dir="rtl"] .explanation::before {
    right: auto;
    left: 15px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .detailed-results h2 {
        font-size: 1.2rem;
        padding: 1rem 1.5rem;
    }
    
    .question-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
        text-align: right;
    }
    
    .question-header .question-grade {
        align-self: flex-end;
    }
    
    .question-content {
        padding: 1rem;
    }
    
    .question-text {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .user-answer,
    .correct-answer,
    .explanation {
        padding: 0.75rem 1rem;
    }
}

/* Print Styles */
@media print {
    .detailed-results {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .detailed-results h2 {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .question-review {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
}