/* ========================================== */
/* SINKHRON - PREMIUM CAPSULE HEADER DESIGN */
/* ========================================== */

/* View All Courses Link Styles */
.view-all-link {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 10px 16px !important;
    background: linear-gradient(135deg, #f43a09 0%, #ff6b35 100%);
    color: white !important;
    border-radius: 25px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.view-all-link:hover {
    background: linear-gradient(135deg, #d63002 0%, #f43a09 100%);
    transform: translateX(5px);
}

.view-all-link i {
    font-size: 1rem;
}

.view-all-link strong {
    font-weight: 600;
}

/* Mega Menu CTA Styles */
.mega-menu-cta {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
}

.mega-menu-all-courses {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 12px 20px !important;
    background: linear-gradient(135deg, #f43a09 0%, #ff6b35 100%);
    color: white !important;
    border-radius: 30px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(244, 58, 9, 0.3);
    min-width: 140px;
    justify-content: center;
}

.mega-menu-all-courses:hover {
    background: linear-gradient(135deg, #d63002 0%, #f43a09 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 58, 9, 0.4);
    color: white !important;
}

.mega-menu-all-courses i {
    font-size: 1rem;
}

/* Ensure mega-menu-container has relative positioning for absolute child */
.mega-menu-container {
    position: relative;
}

/* Reset & Base Styles */
.main-nav,
.main-nav *,
.main-nav *::before,
.main-nav *::after {
  box-sizing: border-box;
}

/* ========================================== */
/* MAIN CAPSULE CONTAINER */
/* ========================================== */

.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: 16px 24px;
  /* Smooth backdrop transitions and header movement */
  transition: backdrop-filter 300ms ease,
              box-shadow 300ms ease,
              transform 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}

/* Enhanced hardware acceleration */
.main-nav {
  backface-visibility: hidden;
  perspective: 1000px;
  transform-style: preserve-3d;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header Scrolled State */
/* .main-nav.scrolled {
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
} */

/* Header Hidden/Visible States */
.main-nav.header-hidden {
  transform: translateY(-100%);
}

.main-nav.header-visible {
  transform: translateY(0);
}

/* Hide mega menu when header is hidden */
.main-nav.header-hidden .mega-menu {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateX(-50%) translateY(-20px) !important;
}



/* Main capsule container */
.main-nav .container {
  display: flex;
  align-items: center;
  place-self: anchor-center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 50px;
  padding: 8px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
              0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: all;
  /* Optimized transitions - only animate specific properties */
  transition: background 300ms ease,
              box-shadow 300ms ease,
              border-color 300ms ease,
              backdrop-filter 300ms ease;
  height: 64px;
  /* Performance optimization */
  will-change: background, box-shadow, backdrop-filter;
}


/* ========================================== */
/* LOGO SECTION */
/* ========================================== */

.navbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  z-index: 10010;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* margin-right: 20px; */
}

.navbar-brand:hover {
  transform: scale(1.02);
}

.navbar-brand img {
  height: 60px;
  width: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ========================================== */
/* NAVIGATION MENU */
/* ========================================== */

.navbar-collapse {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex: 1;
  margin: 0 20px;
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 4px;
  gap: 2px;
  background: rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(5px);
  border-radius: 28px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item {
  position: static;
}

.nav-item .nav-link {
  color: var(--text-primary);
  text-decoration: none;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-item .nav-link:hover,
.nav-item.menu-active .nav-link {
  color: white;
  background: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(244, 58, 9, 0.4);
}

.nav-item .nav-link i {
  font-size: 0.7rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.7;
}

.nav-item.has-mega-menu:hover .nav-link i,
.nav-item.has-mega-menu.menu-active .nav-link i {
  transform: rotate(180deg);
  opacity: 1;
}

/* ========================================== */
/* CONTROLS SECTION */
/* ========================================== */

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10010;
}

/* Language Switcher */
.header-language-switcher {
  position: relative;
}

.current-lang {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 42px;
  text-align: center;
  display: inline-block;
  text-decoration: none;
  line-height: 1;
}

.current-lang:hover {
  background: var(--color-primary) !important;
  color: white !important;
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(244, 58, 9, 0.3);
}

.current-lang:focus {
  outline: none;
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Theme Switcher Integration */
.theme-switcher {
  display: flex;
  align-items: center;
}

/* ========================================== */
/* MEGA MENU SYSTEM */
/* ========================================== */

.mega-menu {
  position: fixed;
  top: 57.7px;
  left: 42%;
  transform: translateX(-50%) translateY(-20px);
  width: calc(100vw - 48px);
  max-width: 1200px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15),
              0 4px 16px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              visibility 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 10020;
  pointer-events: none;
  overflow: hidden;
}

.nav-item.has-mega-menu:hover .mega-menu,
.nav-item.has-mega-menu.menu-active .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.mega-menu-container {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 320px;
  max-height: 450px;
}

/* ========================================== */
/* MEGA MENU CARD WITH VIDEO */
/* ========================================== */

.mega-menu-card {
  position: relative;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              background 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-media-container {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-radius: 16px;
  margin: 0 auto 20px;
  max-width: 360px;
}

.card-placeholder,
.card-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 107%;
  object-fit: cover;
  border-radius: 16px;
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-placeholder {
  z-index: 2;
  opacity: 1;
}

.card-video {
  z-index: 1;
  opacity: 0;
}

.mega-menu-card:hover .card-placeholder {
  opacity: 0;
}

.mega-menu-card:hover .card-video {
  opacity: 1;
}

.card-content {
  text-align: center;
  padding: 0 24px 24px;
}

.card-content h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  font-weight: 600;
  line-height: 1.3;
}

.card-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
  opacity: 0.8;
}

/* ========================================== */
/* MEGA MENU CONTENT */
/* ========================================== */

.mega-menu-content {
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-content: start;
}

.menu-column h4 {
  font-size: 0.75rem;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
  font-weight: 700;
}

.menu-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-links a {
  color: var(--text-primary);
  text-decoration: none;
  padding: 10px 14px;
  display: block;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.9rem;
}

.menu-links a:hover {
  color: white;
  background: var(--color-primary);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(244, 58, 9, 0.3);
}

/* ========================================== */
/* BODY PADDING ADJUSTMENT */
/* ========================================== */

body {
  padding-top: 0;
}


/* ========================================== */
/* DYNAMIC SHRINKING */
/* ========================================== */

/* Dynamic shrinking from 1250px to 1024px */
@media (max-width: 1250px) {
  .main-nav .container {
    max-width: calc(100vw - 48px);
  }
  
  .nav-item .nav-link {
    padding: 9px 15px;
    font-size: 0.9rem;
  }
  
  .mega-menu {
    width: calc(100vw - 60px);
    left: 43%;
    top: 58.1px;
  }
  .navbar-brand img {
    height: 51px;
  }
}

@media (max-width: 1150px) {
  .nav-item .nav-link {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
  
  .mega-menu {
    width: calc(100vw - 70px);
    left: 42%;
    top: 55px;
  }
  .navbar-brand img {
    height: 51px;
  }
}

@media (max-width: 1050px) {
  .nav-item .nav-link {
    padding: 5px 10px;
    font-size: 0.8rem;
  }
  
  /* .mega-menu {
    width: calc(100vw - 80px);
    left: 47.1%;
    top: 52.8px;
  } */
  .navbar-brand img {
    height: 51px;
  }
  .navbar-brand img {
    height: 51px;
  }
}

/* ========================================== */
/* BURGER MENU */
/* ========================================== */

@media (max-width: 1023px) {
  /* Hide desktop navigation */
  .navbar-collapse {
    display: none !important;
  }
  
  /* Show burger menu */
  .burger-menu {
    display: block !important;
  }
  
  .main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
  }
  
  /* Center the logo */
  .navbar-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin-right: 0;
  }
  
  /* Position controls on the right */
  .header-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10010;
    margin-right: 292px;
    margin-bottom: 1px;
  }
  
  /* Smaller language switcher for mobile */
  .current-lang {
    padding: 6px 10px;
    font-size: 0.75rem;
    min-width: 36px;
  }
  
  /* Smaller theme toggle for mobile */
  .theme-toggle-wrapper .theme-toggle {
    width: 50px;
    height: 24px;
  }
  
  .theme-toggle-wrapper .theme-toggle-button {
    width: 20px;
    height: 20px;
  }
}

/* Burger Menu Styles */
.burger-menu {
  display: none;
  position: relative;
}

.burger-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
  margin-bottom: 10px !important;
}

/* .burger-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
} */

.burger-icon {
  width: 24px;
  height: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.burger-line {
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.burger-toggle.active .burger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.burger-toggle.active .burger-line:nth-child(2) {
  opacity: 0;
}

.burger-toggle.active .burger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Burger Dropdown */
.burger-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 30px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  min-width: 363px;
  max-height: 70vh;
  overflow-y: auto;
  margin-top: -1px;
}

.burger-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.burger-menu-list {
  list-style: none;
  margin: 0;
  padding: 16px;
}

.burger-menu-item {
  margin-bottom: 2px;
}

.burger-menu-link {
  display: block;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.burger-menu-link:hover {
  background: var(--color-primary);
  color: white;
  transform: translateX(4px);
}

.burger-submenu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.3s ease;
  font-weight: 500;
  cursor: pointer;
}

.burger-submenu-toggle:hover {
  background: var(--color-primary);
  color: white;
}

.burger-submenu-toggle .fa-chevron-down {
  transition: transform 0.3s ease;
  font-size: 0.7rem;
}

.burger-submenu-toggle.active .fa-chevron-down {
  transform: rotate(180deg);
}

.burger-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.burger-submenu.active {
  max-height: 500px;
}

.burger-submenu-category {
  padding: 8px 16px 4px 32px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  opacity: 0.7;
}

.burger-submenu-link {
  display: block;
  padding: 8px 16px 8px 32px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  border-radius: 8px;
  margin: 2px 8px;
}

.burger-submenu-link:hover {
  background: rgba(244, 58, 9, 0.1);
  color: var(--color-primary);
  transform: translateX(4px);
}

/* ========================================== */
/* RESPONSIVE DESIGN */
/* ========================================== */

@media (max-width: 1024px) {
  .main-nav .container {
    max-width: 100%;
    margin: 0 16px;
  }
  
  .mega-menu {
    width: calc(98vw - 32px);
    /* max-width: 100%; */
    left: 42%;
  }
  
  .mega-menu-container {
    grid-template-columns: 320px 1fr;
  }
  
  .card-media-container {
    max-width: 280px;
    height: 180px;
  }
  .navbar-brand img {
    height: 51px;
  }
}

@media (max-width: 768px) {
  .main-nav {
    padding: 12px 16px;
  }
  
  .main-nav .container {
    border-radius: 40px;
    padding: 6px 16px;
    height: 56px;
  }
  
  .navbar-brand img {
    height: 56px;
  }
  
  .nav-item .nav-link {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  
  .mega-menu {
    top: 72px;
    width: calc(100vw - 24px);
    max-width: 100%;
  }
  
  
  .mega-menu-container {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  
  .mega-menu-card {
    display: none;
  }
  
  .mega-menu-content {
    padding: 24px;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

/* Mobile Specific Breakpoints - Dynamic Scaling */
@media (max-width: 430px) {
  .main-nav {
    padding: clamp(4px, 1.5vw, 8px) clamp(4px, 2vw, 8px);
  }
  
  .main-nav .container {
    border-radius: clamp(20px, 6.5vw, 28px);
    padding: clamp(2px, 0.8vw, 3px) clamp(4px, 2vw, 8px);
    height: clamp(32px, 10vw, 48px);
    right: clamp(15px, 3.5vw, 16px);
  }
  
  .navbar-brand img {
    height: clamp(34px, 11vw, 48px);
  }
  
  .header-controls {
    gap: clamp(3px, 1.4vw, 6px);
  }
  
  .current-lang {
    padding: clamp(2px, 1vw, 4px) clamp(4px, 1.4vw, 6px);
    font-size: clamp(0.55rem, 2.2vw, 0.95rem);
    min-width: clamp(24px, 8vw, 35px);
    margin-right: clamp(232px, 60vw, 259px);
    margin-bottom: clamp(2px, 1.8vw, 7px);
  }
  
  .theme-toggle-wrapper .theme-toggle {
    width: clamp(32px, 10vw, 44px);
    height: clamp(16px, 5vw, 22px);
    right: clamp(0px, 1.2vw, 5px);
    left: auto;
  }
  
  .theme-toggle-wrapper .theme-toggle-button {
    width: clamp(12px, 4.2vw, 18px);
    height: clamp(12px, 4.2vw, 18px);
  }
  
  .burger-icon {
    width: clamp(20px, 6vw, 26px);
    height: clamp(17px, 4.2vw, 18px);
  }
  
  .burger-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: clamp(6px, 2vw, 8px);
    border-radius: 8px;
    transition: all 0.3s ease;
  }
  
  .burger-dropdown {
    min-width: clamp(308px, 92vw, 397px);
    max-height: clamp(70vh, 80vh, 90vh);
    margin-top: clamp(-9px, -2vw, -4px);
    overflow-y: auto;
  }
}

/* ========================================== */
/* THEME SUPPORT */
/* ========================================== */

[data-theme="dark"] .main-nav .container {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .nav-menu {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .current-lang {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .mega-menu {
  background: rgba(15, 23, 42, 0.98);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .mega-menu-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
}

[data-theme="dark"] .language-dropdown {
  background: rgba(15, 23, 42, 0.98);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ========================================== */
/* ACCESSIBILITY */
/* ========================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles */
/* .nav-link:focus,
.current-lang:focus,
.language-option:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
} */