/* Modern Dark Theme for Homepage */
:root {
  --dark-bg: #000000; /* Changed from #080808 to pure black */
  --dark-bg-lighter: #0a0a0a; /* Also made darker */
  --dark-card: #141414;
  --dark-border: #232323;
  --dark-text-primary: #f5f5f5;
  --dark-text-secondary: #aaaaaa;
  --accent-color: #3A80C1;
  --accent-hover: #2a6dac;
  --gradient-primary: linear-gradient(135deg, #3A80C1 0%, #173956 100%);
  --gradient-dark: linear-gradient(135deg, #141414 0%, #0a0a0a 100%);
  --glow-color: rgba(58, 128, 193, 0.4);
  --card-radius: 12px;
  --soft-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body {
  background-color: #121212; /* Explicit black background */
  color: var(--dark-text-primary);
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
}

/* General Styles */
.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
  color: #ffffff; /* Explicitly set to pure white */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); /* Add subtle text shadow for better readability */
}

.section-title:after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 80px;
  height: 4px;
  background: var(--accent-color);
  border-radius: 2px;
}

.section-description {
  color: rgba(255, 255, 255, 0.8); /* Slightly less bright than headers but still very visible */
  font-size: 1.1rem;
  max-width: 800px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.dark-section {
  padding: 100px 0;
  position: relative;
  margin: 0;
  background-color: #121212; /* Explicit black background for sections */
}

.dark-section:nth-child(even) {
  background-color: var(--dark-bg-lighter);
}

/* Fix section layout to ensure proper stacking */
.dark-theme-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #121212; /* Ensure black background */
}

/* Hero Section with Animated Stars */
.dark-hero {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background-color: #121212;
  margin-bottom: 0; /* Remove any gap */
}

/* Rest of your existing CSS */
/* ...existing styles... */

/* App academy section - ensure dark background */
.app-academy.dark-section {
  background-color: rgba(18,18,18,0);
  position: relative;
  overflow: hidden;
  padding: 20px 0;
  z-index: 1;
  margin-top: 0;
}

/* Category cards section */
.categories-section {
  background-color: #121212;
  position: relative;
  z-index: 2;
}

.categories-section .section-title {
  color: #ffffff;
}

/* Category cards styling */
.categories-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 2rem;
}

.category-card {
  background-color: var(--dark-card);
  border-radius: var(--card-radius);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--dark-border);
  box-shadow: var(--soft-shadow);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.category-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 30%, var(--glow-color), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-card:hover .card-glow {
  opacity: 0.5;
}

.category-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease;
}

.category-icon i {
  font-size: 1.8rem;
  color: white;
}

.category-card:hover .category-icon {
  transform: scale(1.1) rotate(5deg);
}

.category-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--dark-text-primary);
}

.category-description {
  color: var(--dark-text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex: 1;
}

.card-action {
  margin-top: auto;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-color);
  font-weight: 500;
  text-decoration: none;
  transition: gap 0.3s ease;
}

.card-link:hover {
  gap: 0.8rem;
  color: var(--accent-hover);
}

/* Mission section */
.mission-section {
  position: relative;
  background-color: #121212;
  overflow: hidden;
}

.mission-section .section-title {
  color: #ffffff;
}

.parallax-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle at 20% 50%, rgba(58, 128, 193, 0.1) 0%, transparent 60%),
              radial-gradient(circle at 70% 20%, rgba(58, 128, 193, 0.05) 0%, transparent 60%);
  z-index: 0;
}

.mission-description {
  max-width: 800px;
  margin: 0 auto 3rem;
}

.mission-description p {
  color: rgba(255, 255, 255, 0.9); /* Very light color for mission description */
  line-height: 1.8;
}

.mission-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.mission-card {
  background-color: var(--dark-card);
  border-radius: var(--card-radius);
  padding: 2rem;
  border: 1px solid var(--dark-border);
  box-shadow: var(--soft-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mission-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.mission-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.mission-icon i {
  font-size: 1.8rem;
  color: white;
}

.mission-card h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark-text-primary);
}

.mission-card p {
  color: var(--dark-text-secondary);
  line-height: 1.6;
}

/* About section */
.about-section {
  position: relative;
  background-color: #121212;
  overflow: hidden;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.about-text p {
  color: var(--dark-text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon i {
  font-size: 1.5rem;
  color: white;
}

.feature-item span {
  font-weight: 500;
  color: var(--dark-text-primary);
}

.image-gallery {
  position: relative;
  height: 450px;
}

.gallery-img {
  position: absolute;
  border-radius: var(--card-radius);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: var(--soft-shadow);
  border: 4px solid var(--dark-card);
}

.gallery-img.img1 {
  width: 75%;
  height: 60%;
  top: 0;
  left: 0;
  z-index: 3;
}

.gallery-img.img2 {
  width: 60%;
  height: 50%;
  bottom: 0;
  right: 0;
  z-index: 1;
}

.gallery-img.img3 {
  width: 45%;
  height: 40%;
  bottom: 20%;
  left: 15%;
  z-index: 2;
}

/* CTA Section */
.cta-section {
  position: relative;
  background-color: #121212;
  padding: 80px 0;
  text-align: center;
  overflow: hidden;
}

.cta-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.85) 100%),
              url('{% static "img/pattern-dark.png" %}');
  background-size: cover;
  opacity: 0.4;
  z-index: 0;
}

.cta-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.cta-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--dark-text-primary);
}

.cta-content p {
  font-size: 1.1rem;
  color: var(--dark-text-secondary);
  margin-bottom: 2.5rem;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .image-gallery {
    height: 400px;
  }
}

@media (max-width: 767.98px) {
  .dark-section {
    padding: 60px 0;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .section-description {
    font-size: 1rem;
  }
  
  .categories-container {
    gap: 20px;
  }
  
  .mission-cards {
    gap: 1.5rem;
  }
  
  .image-gallery {
    height: 350px;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  .cta-content h2 {
    font-size: 2rem;
  }
}

/* Responsive fixes for mobile devices */

/* Fix Handel Education title scaling on small screens */
@media (max-width: 767.98px) {
  .glitch-text {
    font-size: 3.5rem; /* Reduced from 6rem for smaller screens */
    letter-spacing: 1px; /* Less spacing to fit better */
  }
  
  /* Adjust hero tagline size for mobile */
  .hero-tagline {
    font-size: 2.2rem; /* Reduced from 3.5rem */
    margin-bottom: 2.5rem;
    min-height: 2.5rem; /* Reduced height */
    gap: 0.5rem; /* Less gap between texts */
  }
  
  /* Ensure typing text fits on small screens */
  .typing-text {
    min-width: 80px; /* Smaller min-width */
  }
}

/* Further reduce Handel Education title size on phones */
@media (max-width: 767.98px) {
  .glitch-text {
    font-size: 2.8rem; /* Reduced further for better fit on mobile */
  }
}

@media (max-width: 576px) {
  .glitch-text {
    font-size: 2.2rem; /* Even smaller on extra small screens */
    letter-spacing: 1px;
  }
}

@media (max-width: 360px) {
  .glitch-text {
    font-size: 1.8rem; /* Extremely small screens */
    letter-spacing: 0.5px;
  }
}

/* Even smaller screens get further reductions */
@media (max-width: 480px) {
  .glitch-text {
    font-size: 2.5rem; /* Further reduced size */
    margin-bottom: 1rem;
  }
  
  .hero-tagline {
    font-size: 1.8rem;
    margin-bottom: 2rem;
  }
}

/* Fix category button text overflow */
@media (max-width: 767.98px) {
  /* Better text handling in category buttons */
  .category-btn {
    padding: 0.6rem 1rem; /* Reduced padding */
    font-size: 0.85rem; /* Smaller font */
    min-width: 100px; /* Minimum width adjusted */
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflowing text */
    text-overflow: ellipsis; /* Add ellipsis if text overflows */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Better icon handling in category buttons */
  .category-btn i {
    margin-right: 0.3rem; /* Less margin */
    font-size: 0.9rem; /* Smaller icon */
  }
}

@media (max-width: 575.98px) {
  .dark-section {
    padding: 50px 0;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .image-gallery {
    height: 300px;
  }
  
  .cta-content h2 {
    font-size: 1.7rem;
  }
  
  .cta-button.large {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
}

/* Scroll indicator styling */
.scroll-indicator {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  animation: fadeIn 1.5s 1s forwards;
  opacity: 0;
}

.mouse {
  width: 30px;
  height: 50px;
  border: 2px solid var(--dark-text-primary);
  border-radius: 20px;
  position: relative;
  margin-bottom: 10px;
}

.wheel {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--dark-text-primary);
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll 2s infinite;
}

.arrows {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.arrow-down {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--dark-text-primary);
  border-bottom: 2px solid var(--dark-text-primary);
  transform: rotate(45deg);
  margin-bottom: 5px;
}

.arrow-down:nth-child(1) {
  animation: arrowDown 2s infinite;
}

.arrow-down:nth-child(2) {
  animation: arrowDown 2s infinite 0.5s;
}

@keyframes scroll {
  0% {
    opacity: 1;
    top: 10px;
  }
  100% {
    opacity: 0;
    top: 30px;
  }
}

@keyframes arrowDown {
  0% {
    opacity: 0;
    transform: rotate(45deg) translate(-5px, -5px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) translate(5px, 5px);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* CTA Button Styling */
.cta-button {
  all: unset;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  position: relative;
  border-radius: 999vw;
  background-color: rgba(58, 128, 193, 0.85);
  box-shadow: -0.15em -0.15em 0.15em -0.075em rgba(5, 5, 5, 0.25),
      0.0375em 0.0375em 0.0675em 0 rgba(5, 5, 5, 0.1);
  text-decoration: none;
  margin: 1rem 0;
  display: inline-block;
}

.cta-button::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: calc(100% + 0.3em);
  height: calc(100% + 0.3em);
  top: -0.15em;
  left: -0.15em;
  border-radius: inherit;
  background: linear-gradient(-135deg,
          rgba(5, 5, 5, 0.5),
          transparent 20%,
          transparent 100%);
  filter: blur(0.0125em);
  opacity: 0.25;
  mix-blend-mode: multiply;
}

.button-outer {
  position: relative;
  z-index: 1;
  border-radius: inherit;
  transition: box-shadow 300ms ease;
  will-change: box-shadow;
  box-shadow: 0 0.05em 0.05em -0.01em rgba(5, 5, 5, 1),
      0 0.01em 0.01em -0.01em rgba(5, 5, 5, 0.5),
      0.15em 0.3em 0.1em -0.01em rgba(5, 5, 5, 0.25);
  display: block;
}

.cta-button:hover .button-outer {
  box-shadow: 0 0 0 0 rgba(5, 5, 5, 1), 0 0 0 0 rgba(5, 5, 5, 0.5),
      0 0 0 0 rgba(5, 5, 5, 0.25);
}

.button-inner {
  --inset: 0.035em;
  position: relative;
  z-index: 1;
  border-radius: inherit;
  padding: 0.75em 1.5em;
  background-image: linear-gradient(135deg,
          rgba(65, 155, 230, 1),
          rgba(45, 125, 195, 1));
  transition: box-shadow 300ms ease, clip-path 250ms ease,
      background-image 250ms ease, transform 250ms ease;
  will-change: box-shadow, clip-path, background-image, transform;
  overflow: clip;
  clip-path: inset(0 0 0 0 round 999vw);
  box-shadow:
      /* 1 */
      0 0 0 0 inset rgba(5, 5, 5, 0.1),
      /* 2 */
      -0.05em -0.05em 0.05em 0 inset rgba(5, 5, 5, 0.25),
      /* 3 */
      0 0 0 0 inset rgba(5, 5, 5, 0.1),
      /* 4 */
      0 0 0.05em 0.2em inset rgba(255, 255, 255, 0.25),
      /* 5 */
      0.025em 0.05em 0.1em 0 inset rgba(255, 255, 255, 0.5),
      /* 6 */
      0.12em 0.12em 0.12em inset rgba(255, 255, 255, 0.25),
      /* 7 */
      -0.075em -0.25em 0.25em 0.1em inset rgba(5, 5, 5, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.cta-button:hover .button-inner {
  clip-path: inset(clamp(1px, 0.0625em, 2px) clamp(1px, 0.0625em, 2px) clamp(1px, 0.0625em, 2px) clamp(1px, 0.0625em, 2px) round 999vw);
  box-shadow:
      /* 1 */
      0.1em 0.15em 0.05em 0 inset rgba(5, 5, 5, 0.75),
      /* 2 */
      -0.025em -0.03em 0.05em 0.025em inset rgba(5, 5, 5, 0.5),
      /* 3 */
      0.25em 0.25em 0.2em 0 inset rgba(5, 5, 5, 0.5),
      /* 4 */
      0 0 0.05em 0.5em inset rgba(255, 255, 255, 0.15),
      /* 5 */
      0 0 0 0 inset rgba(255, 255, 255, 0.5),
      /* 6 */
      0.12em 0.12em 0.12em inset rgba(255, 255, 255, 0.25),
      /* 7 */
      -0.075em -0.12em 0.2em 0.1em inset rgba(5, 5, 5, 0.25);
}

.cta-text {
  position: relative;
  z-index: 4;
  font-family: "Poppins", sans-serif;
  letter-spacing: -0.02em;
  font-weight: 600;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.95);
  transition: transform 250ms ease;
  display: block;
  will-change: transform;
  text-shadow: rgba(0, 0, 0, 0.2) 0 0 0.1em;
  -webkit-user-select: none; 
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.cta-button:hover .button-inner .cta-text {
  transform: scale(0.975);
}

.cta-button:active .button-inner {
  transform: scale(0.975);
}

.cta-icon {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.1rem;
  transition: transform 250ms ease;
}

.cta-button:hover .cta-icon {
  transform: translateX(3px);
}

/* Adjust styles for the large CTA button */
.cta-button.large {
  font-size: 1.2rem;
  margin: 1.5rem 0;
}

.cta-button.large .button-inner {
  padding: 1em 2em;
}

/* Remove old CTA button styles that conflict */
.cta-button:hover {
  transform: none;
  box-shadow: none;
}

/* Hero Tagline */
.hero-tagline {
  font-size: 3.5rem; /* Increased from 2.5rem to 3.5rem */
  margin-bottom: 3.5rem;
  color: #ffffff;
  font-weight: 800; /* Increased from 600 to 800 for bolder text */
  direction: rtl;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  min-height: 4rem; /* Increased for larger text */
  font-family: 'Tajawal', 'Poppins', sans-serif; /* Add Arabic font */
  line-height: 1.2; /* Add consistent line height */
}

.static-text {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4); /* Add glow effect */
}

.typing-text {
  color: var(--accent-color);
  position: relative;
  display: inline-block;
  min-width: 120px; /* Increased width for Arabic text */
  text-shadow: 0 0 10px rgba(58, 128, 193, 0.4); /* Add glow effect */
  height: 1.2em; /* Fixed height to prevent shifting */
  vertical-align: baseline; /* Improve alignment */
}

/* Fix cursor position for RTL */
.typing-text::after {
  content: '|';
  position: absolute;
  left: -8px; /* Changed from right to left for RTL */
  top: 0; /* Align to top */
  color: #ffffff;
  animation: blink 0.8s step-end infinite; /* Make blink faster */
}

/* Glitch Animation */
@keyframes glitch {
  0% {
    text-shadow: 0.05em 0 0 rgba(58, 128, 193, 0.75),
                -0.05em -0.025em 0 rgba(255, 255, 255, 0.75);
  }
  14% {
    text-shadow: 0.05em 0 0 rgba(58, 128, 193, 0.75),
                -0.05em -0.025em 0 rgba(255, 255, 255, 0.75);
  }
  15% {
    text-shadow: -0.05em -0.025em 0 rgba(58, 128, 193, 0.75),
                0.025em 0.025em 0 rgba(255, 255, 255, 0.75);
  }
  49% {
    text-shadow: -0.05em -0.025em 0 rgba(58, 128, 193, 0.75),
                0.025em 0.025em 0 rgba(255, 255, 255, 0.75);
  }
  50% {
    text-shadow: 0.025em 0.05em 0 rgba(58, 128, 193, 0.75),
                0.05em 0 0 rgba(255, 255, 255, 0.75);
  }
  99% {
    text-shadow: 0.025em 0.05em 0 rgba(58, 128, 193, 0.75),
                0.05em 0 0 rgba(255, 255, 255, 0.75);
  }
  100% {
    text-shadow: -0.025em 0 0 rgba(58, 128, 193, 0.75),
                -0.025em -0.025em 0 rgba(255, 255, 255, 0.75);
  }
}

/* Fix for the Nos formations section */
.categories-container-scroll {
  overflow-x: auto;
  padding: 5px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) transparent;
  margin-bottom: 1rem;
  width: 100%;
}

/* Fix the course list container */
.course-list-container {
  position: relative;
  min-height: 300px;
}

.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.loader {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(58, 128, 193, 0.2);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Preserve the glitch effect for "Handel Education" */
.glitch-text {
  position: relative;
  font-size: 6rem; /* Increased from 5rem to 6rem */
  font-weight: 900; /* Increased from 800 to 900 for bolder text */
  text-transform: uppercase;
  color: var(--dark-text-primary);
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4); /* Add glow effect */
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch-text::before {
  left: 2px;
  text-shadow: -2px 0 var(--accent-color);
  clip: rect(0, 900px, 0, 0);
  animation: glitch-anim 2s infinite linear alternate-reverse;
}

.glitch-text::after {
  left: -2px;
  text-shadow: -2px 0 var(--accent-hover);
  clip: rect(0, 900px, 0, 0);
  animation: glitch-anim2 2s infinite linear alternate-reverse;
}

/* Fix keyframe definitions to make glitch effect more noticeable */
@keyframes glitch-anim {
  0% {
    clip: rect(44px, 9999px, 44px, 0);
    transform: skew(0.1deg);
  }
  5% {
    clip: rect(85px, 9999px, 71px, 0);
    transform: skew(0.2deg);
  }
  10% {
    clip: rect(26px, 9999px, 25px, 0);
    transform: skew(0.5deg);
  }
  15% {
    clip: rect(92px, 9999px, 5px, 0);
    transform: skew(0.1deg);
  }
  20% {
    clip: rect(30px, 9999px, 3px, 0);
    transform: skew(0.2deg);
  }
  25% {
    clip: rect(54px, 9999px, 73px, 0);
    transform: skew(0.5deg);
  }
  30% {
    clip: rect(86px, 9999px, 72px, 0);
    transform: skew(0.1deg);
  }
  35% {
    clip: rect(84px, 9999px, 23px, 0);
    transform: skew(0.2deg);
  }
  40% {
    clip: rect(8px, 9999px, 72px, 0);
    transform: skew(0.5deg);
  }
  45% {
    clip: rect(73px, 9999px, 75px, 0);
    transform: skew(0.1deg);
  }
  50% {
    clip: rect(13px, 9999px, 93px, 0);
    transform: skew(0.2deg);
  }
  55% {
    clip: rect(12px, 9999px, 80px, 0);
    transform: skew(0.5deg);
  }
  60% {
    clip: rect(71px, 9999px, 27px, 0);
    transform: skew(0.1deg);
  }
  65% {
    clip: rect(84px, 9999px, 15px, 0);
    transform: skew(0.2deg);
  }
  70% {
    clip: rect(44px, 9999px, 49px, 0);
    transform: skew(0.5deg);
  }
  75% {
    clip: rect(2px, 9999px, 57px, 0);
    transform: skew(0.1deg);
  }
  80% {
    clip: rect(41px, 9999px, 40px, 0);
    transform: skew(0.2deg);
  }
  85% {
    clip: rect(40px, 9999px, 76px, 0);
    transform: skew(0.5deg);
  }
  90% {
    clip: rect(73px, 9999px, 12px, 0);
    transform: skew(0.1deg);
  }
  95% {
    clip: rect(1px, 9999px, 50px, 0);
    transform: skew(0.2deg);
  }
  100% {
    clip: rect(62px, 9999px, 70px, 0);
    transform: skew(0.5deg);
  }
}

@keyframes glitch-anim2 {
  0% {
    clip: rect(99px, 9999px, 62px, 0);
    transform: skew(-0.1deg);
  }
  5% {
    clip: rect(29px, 9999px, 12px, 0);
    transform: skew(-0.3deg);
  }
  10% {
    clip: rect(65px, 9999px, 71px, 0);
    transform: skew(-0.2deg);
  }
  15% {
    clip: rect(6px, 9999px, 88px, 0);
    transform: skew(-0.1deg);
  }
  20% {
    clip: rect(10px, 9999px, 27px, 0);
    transform: skew(-0.3deg);
  }
  25% {
    clip: rect(34px, 9999px, 12px, 0);
    transform: skew(-0.2deg);
  }
  30% {
    clip: rect(73px, 9999px, 54px, 0);
    transform: skew(-0.1deg);
  }
  35% {
    clip: rect(87px, 9999px, 33px, 0);
    transform: skew(-0.3deg);
  }
  40% {
    clip: rect(50px, 9999px, 34px, 0);
    transform: skew(-0.2deg);
  }
  45% {
    clip: rect(50px, 9999px, 64px, 0);
    transform: skew(-0.1deg);
  }
  50% {
    clip: rect(18px, 9999px, 24px, 0);
    transform: skew(-0.3deg);
  }
  55% {
    clip: rect(61px, 9999px, 57px, 0);
    transform: skew(-0.2deg);
  }
  60% {
    clip: rect(100px, 9999px, 20px, 0);
    transform: skew(-0.1deg);
  }
  65% {
    clip: rect(56px, 9999px, 45px, 0);
    transform: skew(-0.3deg);
  }
  70% {
    clip: rect(35px, 9999px, 62px, 0);
    transform: skew(-0.2deg);
  }
  75% {
    clip: rect(87px, 9999px, 3px, 0);
    transform: skew(-0.1deg);
  }
  80% {
    clip: rect(70px, 9999px, 14px, 0);
    transform: skew(-0.3deg);
  }
  85% {
    clip: rect(17px, 9999px, 58px, 0);
    transform: skew(-0.2deg);
  }
  90% {
    clip: rect(22px, 9999px, 59px, 0);
    transform: skew(-0.1deg);
  }
  95% {
    clip: rect(3px, 9999px, 92px, 0);
    transform: skew(-0.3deg);
  }
  100% {
    clip: rect(98px, 9999px, 72px, 0);
    transform: skew(-0.2deg);
  }
}

/* Clear blink animation */
@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* Improved typing text container to prevent shifting */
.hero-tagline {
  /* ...existing styles... */
  line-height: 1.2; /* Add consistent line height */
}

.typing-text {
  color: var(--accent-color);
  position: relative;
  display: inline-block;
  min-width: 120px;
  text-shadow: 0 0 10px rgba(58, 128, 193, 0.4);
  height: 1.2em; /* Fixed height to prevent shifting */
  vertical-align: baseline; /* Improve alignment */
}

/* Fix cursor position for RTL and vertical alignment */
.typing-text::after {
  content: '|';
  position: absolute;
  left: -8px;
  top: 0; /* Align to top */
  color: #ffffff;
  animation: blink 0.8s step-end infinite; /* Make blink faster */
}

/* Enhanced 3D course card styling with full-width image */
.dark-course-card {
  background-color: var(--dark-card);
  border-radius: var(--card-radius);
  overflow: hidden;
  position: relative;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--dark-border);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  transform-style: preserve-3d;
  perspective: 1200px;
}

/* Create depth through transform on hover */
.dark-course-card:hover {
  transform: translateY(-10px) rotateX(5deg) rotateY(-2deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Hand-drawn top edge effect - like a white pencil line */
.dark-course-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 20%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0.3) 80%,
    transparent 100%
  );
  opacity: 0.6;
  z-index: 3;
}

/* Hand-drawn left edge effect - like a white pencil line */
.dark-course-card::after {
  content: '';
  position: absolute;
  top: 5%;
  left: 0;
  bottom: 5%;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 20%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0.3) 80%,
    transparent 100%
  );
  opacity: 0.6;
  z-index: 3;
}

/* Left diagonal highlight to simulate 3D angle */
.dark-course-card .highlight-diagonal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.05) 15%,
    transparent 50%
  );
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dark-course-card:hover .highlight-diagonal {
  opacity: 1;
}

/* Subtle right highlight to complement the left one */
.dark-course-card .highlight-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.dark-course-card:hover .highlight-right {
  opacity: 0.7;
}

/* Bottom highlight to complete the drawn frame */
.dark-course-card .highlight-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 30%,
    rgba(255, 255, 255, 0.1) 70%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.dark-course-card:hover .highlight-bottom {
  opacity: 0.7;
}

/* Add subtle shadow to top-left corner for more depth */
.dark-course-card .corner-shadow {
  position: absolute;
  top: 0;
  left: 0;
  width: 30%;
  height: 30%;
  background: radial-gradient(
    circle at top left,
    rgba(255, 255, 255, 0.1),
    transparent 70%
  );
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dark-course-card:hover .corner-shadow {
  opacity: 1;
}

/* Enhance course image with crisp edge for sketch effect */
.course-image {
  position: relative;
  width: 100%;
  height: 180px; /* Increased height for more visual impact */
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Add subtle texture for more hand-drawn feel */
.course-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none" stroke="white" stroke-opacity="0.03" stroke-width="0.5" stroke-dasharray="2,2"/></svg>');
  opacity: 0.2;
  z-index: 1;
}

.course-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.3s ease;
}

/* Enhance hover effect with slightly sharper image on hover */
.dark-course-card:hover .course-image img {
  transform: scale(1.05);
  filter: brightness(1.05) contrast(1.05);
}

/* Course content with extra padding to enhance 3D effect */
.course-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 3;
  background: linear-gradient(
    180deg,
    var(--dark-card) 0%, 
    rgba(20, 20, 20, 0.95) 100%
  ); /* Subtle gradient for depth */
}

/* Make the action button have a hand-drawn style */
.course-action .action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-weight: 500;
  color: var(--accent-color);
  transition: all 0.3s ease;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

/* Button hover effect */
.course-action .action-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Add a white line to the top of the button for 3D effect */
.course-action .action-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 100%
  );
  opacity: 0.5;
}

/* Make course title height consistent */
.dark-course-card .course-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark-text-primary);
  margin-bottom: 0.6rem;
  min-height: 2.4em;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Improve description display */
.dark-course-card .course-description {
  color: var(--dark-text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.8em; /* Consistent height */
}

/* Course badge - repositioned for better visibility */
.course-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--gradient-primary);
  color: white;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}