:root {
  --primary: #3a0ca3;
  --secondary: #03cfea;
  --accent: #ff7c7c;
  --bg-glass: rgba(255, 255, 255, 0.12);
  --blur: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  --border-color: rgba(255, 255, 255, 0.1);
  --transition: all 0.3s ease;
  --glow: 0 0 20px rgba(0, 188, 212, 0.6);
  /* Z-index management */
  --z-sidebar: 999;
  --z-sidebar-toggle: 1000;
  --z-overlay: 998;
  --z-header: 99;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

body {
  color: white;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background with adjustable opacity */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.background-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.background-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.opacity-control-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur));
  border-radius: 20px;
  padding: 8px 15px;
  z-index: 1000;
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.opacity-control-container label {
  margin-right: 10px;
  font-size: 14px;
}

#opacity-control {
  cursor: pointer;
}

/* Main Container Layout */
.main-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styles */
/* Custom 4-line hamburger icon */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  margin-right: 15px;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.hamburger-lines {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 16px;
  width: 22px;
}

.hamburger-lines .line {
  display: block;
  height: 2px;
  width: 100%;
  background: #1a0dab; /* Deep blue color */
  border-radius: 10px;
}

/* When sidebar is active, transform the hamburger to X */
.sidebar.active ~ .header .hamburger-lines .line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.sidebar.active ~ .header .hamburger-lines .line:nth-child(2),
.sidebar.active ~ .header .hamburger-lines .line:nth-child(3) {
  opacity: 0;
}

.sidebar.active ~ .header .hamburger-lines .line:nth-child(4) {
  transform: translateY(-7px) rotate(-45deg);
}

.sidebar {
  width: 260px;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur));
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--border-color);
  height: 100vh;
  position: fixed;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow);
  border-radius: 0 16px 16px 0;
  transform: translateX(-100%); /* Hidden by default */
}

.sidebar.active {
  transform: translateX(0); /* Visible when active */
}

.sidebar-logo {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
  background: linear-gradient(to right, #fff, #99ecff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: var(--glow);
}

/* Sidebar toggle button - desktop version */
.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  margin: 0 auto 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-toggle-btn:hover {
  background: rgba(58, 12, 163, 0.8);
  transform: scale(1.1);
}

/* Mobile-only hamburger button */
.mobile-sidebar-toggle {
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1000;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: none; /* Hidden on desktop */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.mobile-sidebar-toggle:hover {
  background: rgba(58, 12, 163, 0.8);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.nav-section h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.nav-section a {
  display: block;
  padding: 0.6rem 0.8rem;
  color: white;
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 8px;
  opacity: 0.8;
  transition: var(--transition);
}

.nav-section a:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
  transform: translateX(5px);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

/* Main Content Styles */
.content {
  flex: 1;
  margin-left: 0;
  width: 100%;
  transition: margin-left 0.3s ease;
}

.sidebar.active ~ .content {
  margin-left: 260px;
  width: calc(100% - 260px);
}

/* Header Styles */
.header {
  display: flex;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  box-shadow: var(--shadow);
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
  background: linear-gradient(to right, #fff, #99ecff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-right: 2rem;
  flex-shrink: 0;
}

.logo-img {
  max-width: 80px;
  height: auto;
}

.search-container {
  flex: 1;
  max-width: 600px;
  margin: 0 2rem;
}

.search-bar {
  position: relative;
  display: flex;
}

.search-bar input {
  width: 100%;
  padding: 0.7rem 1rem;
  padding-right: 3rem;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.95rem;
  transition: var(--transition);
}

.search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search-bar input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.search-bar button {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 50px;
  border: none;
  background: transparent;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-link {
  font-size: 1rem;
  color: white;
  text-decoration: none;
  transition: var(--transition);
}

.nav-link:hover {
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-icon {
  display: flex;
  align-items: center;
  position: relative;
}

.notification-icon i {
  font-size: 1.5rem;
  color: white;
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--accent);
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.profile-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: var(--transition);
}

.profile-circle:hover {
  border-color: var(--secondary);
  box-shadow: var(--glow);
}

.profile-image {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

/* Slogan Bar */
.slogan-bar {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur));
  padding: 0.7rem 2rem;
  overflow-x: auto;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-color);
}

.slogan-content {
  display: inline-block;
  animation: scroll-x 20s linear infinite;
}

.slogan-content span {
  display: inline-block;
  padding: 0 1rem;
  font-size: 1rem;
  font-weight: 500;
}

.slogan-content span:first-child {
  color: rgba(255, 255, 255, 0.9);
}

.slogan-content span:last-child {
  color: rgba(255, 255, 255, 0.8);
}

/* Tags Carousel */
.tags-carousel-container {
  display: flex;
  align-items: center;
  padding: 0.7rem 2rem;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

.tags-label {
  margin-right: 1rem;
  font-weight: 500;
  flex-shrink: 0;
}

.tags-carousel {
  display: flex;
  overflow-x: hidden;
  width: 100%;
}

.tags-wrapper {
  display: flex;
  gap: 0.8rem;
  animation: scroll-x 30s linear infinite;
  flex-shrink: 0;
}

.tag {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;  /* Set tag text color to white */
  border: 1px solid var(--border-color);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.tag:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Course Sections */
.courses-section {
  padding: 2rem;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--secondary);
  border-radius: 3px;
}

.section-title span {
  background: rgba(234, 2, 242, 0.911);
  padding: 0.3rem 1rem;
  border-radius: 20px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(248, 246, 250, 0.911);
  margin-left: 1rem;
}

.carousel-container {
  position: relative;
  margin: 0 -10px;
}

.carousel-wrapper {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 0.5rem 0;
  gap: 20px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.carousel-wrapper::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.carousel-arrow:hover {
  background: rgba(58, 12, 163, 0.9); /* Darker blue on hover */
  transform: translateY(-50%) scale(1.1); /* Slight scale effect on hover */
}

.carousel-arrow.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.prev-arrow {
  left: 10px;
}

.next-arrow {
  right: 10px;
}

/* Add this to your existing CSS */
@keyframes flash {
  0% { background: var(--primary); }
  50% { background: var(--secondary); }
  100% { background: var(--primary); }
}

.carousel-arrow.flash {
  animation: flash 0.3s ease;
}

.course-card {
  flex: 0 0 300px;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur));
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--glow), var(--shadow);
  border-color: rgba(0, 188, 212, 0.3);
}

.course-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: var(--transition);
}

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

.course-info {
  padding: 1rem;
}

.course-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.course-meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.4rem;
}

.course-stats {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.8rem;
}

.badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
}

.badge.primary {
  background: rgba(58, 12, 163, 0.6);
  border: 1px solid rgba(58, 12, 163, 0.3);
}

.badge.secondary {
  background: rgba(0, 188, 212, 0.6);
  border: 1px solid rgba(0, 188, 212, 0.3);
}

.badge.info {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Category Cards and Images */
.category-image {
    width: 300px;
    height: 300px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.category-image:hover img.category-thumbnail {
    transform: scale(1.05);
}

.category-icon {
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.category-icon i {
    font-size: 48px;
    color: var(--primary-color);
}

/* Enhanced Category Cards and Images */
.category-card {
    flex: 0 0 auto;
    width: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.category-card h3 {
    font-size: 1.4rem;
    margin: 15px 0;
    font-weight: 600;
    color: #fff;
}

.course-count {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
}

.category-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.stat-item i {
    margin-right: 5px;
    color: var(--secondary);
}

/* Enhanced Explore Button */
.category-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
}

.category-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    color: white;
}

.category-link i {
    transition: transform 0.3s ease;
}

.category-link:hover i {
    transform: translateX(5px);
}

/* Categories Carousel */
.categories-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 20px 0;
    min-height: 420px; /* Accommodate the 300px height plus margins and content */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.categories-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.categories-carousel .category-card {
    flex: 0 0 auto;
    width: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.categories-carousel .category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* Promotional Section */
.promo-section {
  margin: 2rem;
  padding: 3rem;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(58, 12, 163, 0.8), rgba(0, 188, 212, 0.8));
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.promo-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80') center/cover;
  opacity: 0.2;
  z-index: -1;
}

.promo-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.promo-content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.promo-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  
}

.promo-button {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: rgb(255, 136, 0);
  color: #fff;
  color: var(--primary);
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  border: 2px solid transparent;
}


.promo-button:hover {
  background: transparent;
  color: white;
  border-color: white;
  transform: translateY(-3px);
}

/* Footer */
.footer {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur));
  padding: 3rem 2rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

.footer-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-column h3 {
  font-size: 1.3rem;
  margin-bottom: 1.2rem;
}

.footer-column p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.footer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.footer-button {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-button i {
  margin-right: 0.5rem;
}

.footer-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: white;
  text-decoration: underline;
}

.social-buttons {
  display: flex;
  gap: 0.8rem;
}

.social-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: var(--transition);
}

.social-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.copyright {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

/* Animations */
@keyframes scroll-x {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Responsive Styles */
@media (max-width: 1200px) {
  .course-card {
    flex: 0 0 280px;
  }
}

@media (max-width: 992px) {
  .sidebar.active ~ .content {
    margin-left: 0;
    width: 100%;
  }
  
  body.sidebar-open {
    overflow: hidden;
  }
  
  .sidebar.active ~ .sidebar-overlay {
    display: block;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 1rem;
  }
  
  .search-container {
    margin: 0 1rem;
  }
  
  .courses-section {
    padding: 1.5rem 1rem;
  }
  
  .promo-section {
    margin: 1.5rem 1rem;
    padding: 2rem 1.5rem;
  }
  
  .footer {
    padding: 2rem 1rem 1rem;
  }
  
  .sidebar {
    width: 80%;
    max-width: 300px;
  }
  
  /* When sidebar is active on mobile, add overlay */
  .sidebar.active ~ .sidebar-overlay {
    display: block;
  }
}

@media (max-width: 576px) {
  .header-icons {
    gap: 0.8rem;
  }
  
  .search-container {
    display: none;
  }
  
  .logo {
    margin-right: auto;
  }
  
  .carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: