/**
 * Modern Navigation System
 * Mega Menu + Sidebar + Breadcrumbs
 */

/* ========== MEGA MENU ========== */
.nav-menu {
  display: flex;
  gap: 4px;
  align-items: center;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-item > a {
  padding: 16px 18px;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  position: relative;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item > a::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--teal));
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 2px;
}

.nav-item > a:hover {
  color: var(--text);
  background: rgba(17, 153, 142, 0.05);
}

.nav-item > a:hover::after {
  width: 24px;
}

.nav-item > a.active {
  color: var(--brand);
  background: rgba(17, 153, 142, 0.1);
}

.nav-item > a.active::after {
  width: 24px;
}

/* Dropdown Arrow */
.nav-item.has-dropdown > a::before {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-top-color: var(--muted);
  transition: all 0.3s ease;
}

.nav-item.has-dropdown:hover > a::before {
  border-top-color: var(--brand);
  transform: translateY(-50%) rotate(180deg);
}

/* Mega Menu Dropdown */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 700px;
  background: rgba(10, 15, 14, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(17, 153, 142, 0.2);
  border-radius: 16px;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.mega-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-bottom-color: rgba(17, 153, 142, 0.3);
}

.nav-item.has-dropdown:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Mega Menu Grid */
.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.mega-menu-section {
  padding: 8px;
}

.mega-menu-section h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--brand);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--outline);
}

/* Mega Menu Card */
.mega-menu-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(17, 153, 142, 0.03);
  border: 1px solid transparent;
  transition: all 0.3s ease;
  text-decoration: none;
  margin-bottom: 8px;
}

.mega-menu-card:hover {
  background: rgba(17, 153, 142, 0.1);
  border-color: rgba(17, 153, 142, 0.2);
  transform: translateX(4px);
}

.mega-menu-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}

.mega-menu-card-content {
  flex: 1;
  min-width: 0;
}

.mega-menu-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.mega-menu-card-desc {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mega-menu-card-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(17, 153, 142, 0.15);
  color: var(--brand);
  margin-left: 8px;
}

/* Mega Menu Footer */
.mega-menu-footer {
  grid-column: 1 / -1;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--outline);
  display: flex;
  justify-content: center;
}

.mega-menu-footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.mega-menu-footer a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(17, 153, 142, 0.3);
}

/* Sinavlar Badge */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
  background: linear-gradient(135deg, #FF6B6B, #ff5252);
  color: white;
  border-radius: 4px;
  margin-left: 4px;
  text-transform: uppercase;
}

.nav-badge.new {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ========== BREADCRUMBS ========== */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--muted);
  transition: color 0.3s ease;
}

.breadcrumbs a:hover {
  color: var(--brand);
}

.breadcrumbs .separator {
  color: var(--outline);
}

.breadcrumbs .current {
  color: var(--text);
  font-weight: 500;
}

/* ========== COURSE SIDEBAR ========== */
.course-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  min-height: calc(100vh - 200px);
}

.course-sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 16px;
}

.course-sidebar::-webkit-scrollbar {
  width: 4px;
}

.course-sidebar::-webkit-scrollbar-track {
  background: var(--bg-soft);
  border-radius: 2px;
}

.course-sidebar::-webkit-scrollbar-thumb {
  background: var(--brand);
  border-radius: 2px;
}

.sidebar-header {
  padding: 16px;
  background: linear-gradient(135deg, var(--card), rgba(17, 153, 142, 0.05));
  border: 1px solid var(--outline);
  border-radius: 12px;
  margin-bottom: 16px;
}

.sidebar-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.sidebar-header p {
  font-size: 12px;
  color: var(--muted);
}

.sidebar-nav {
  background: var(--card);
  border: 1px solid var(--outline);
  border-radius: 12px;
  overflow: hidden;
}

.sidebar-section {
  border-bottom: 1px solid var(--outline);
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brand);
  background: rgba(17, 153, 142, 0.03);
  cursor: pointer;
  transition: all 0.3s ease;
}

.sidebar-section-title:hover {
  background: rgba(17, 153, 142, 0.08);
}

.sidebar-section-title i {
  font-size: 10px;
  transition: transform 0.3s ease;
}

.sidebar-section.collapsed .sidebar-section-title i {
  transform: rotate(-90deg);
}

.sidebar-section.collapsed .sidebar-links {
  display: none;
}

.sidebar-links {
  padding: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.sidebar-link:hover {
  background: rgba(17, 153, 142, 0.08);
  color: var(--text);
  transform: translateX(4px);
}

.sidebar-link.active {
  background: rgba(17, 153, 142, 0.15);
  color: var(--brand);
  font-weight: 500;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--brand);
  border-radius: 0 2px 2px 0;
}

.sidebar-link-number {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(17, 153, 142, 0.1);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-link.active .sidebar-link-number {
  background: var(--brand);
  color: white;
}

/* Course Content */
.course-content {
  min-width: 0;
}

/* ========== COURSE TABS ========== */
.course-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--outline);
  border-radius: 12px;
  margin-bottom: 24px;
}

.course-tab {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.course-tab:hover {
  color: var(--text);
  background: rgba(17, 153, 142, 0.05);
}

.course-tab.active {
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
}

.course-tab i {
  font-size: 14px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1100px) {
  .mega-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    transform: none;
    min-width: 100%;
    border-radius: 0;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 9999;
  }

  .mega-menu-grid {
    grid-template-columns: 1fr;
  }

  .nav-item.has-dropdown:hover .mega-menu {
    transform: none;
  }

  .course-layout {
    grid-template-columns: 1fr;
  }

  .course-sidebar {
    position: relative;
    top: 0;
    max-height: none;
    margin-bottom: 24px;
  }
}

@media (max-width: 768px) {
  /* Mobil menü - dropdown için özel stiller */
  .mega-menu {
    position: relative;
    top: 0;
    max-height: 50vh;
    padding: 12px;
    margin: 8px 0;
    border-radius: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(10, 15, 14, 0.98);
    border: 1px solid rgba(17, 153, 142, 0.3);
  }

  /* Mobilde hover yerine tıklama ile açılsın */
  .nav-item.has-dropdown .mega-menu {
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-item.has-dropdown.active .mega-menu {
    display: block;
  }

  .mega-menu-card {
    padding: 10px;
  }

  .mega-menu-card-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .mega-menu-section {
    padding: 4px;
  }

  .mega-menu-section h4 {
    font-size: 10px;
    margin-bottom: 8px;
  }

  .mega-menu-footer {
    margin-top: 12px;
    padding-top: 12px;
  }

  .mega-menu-footer a {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }

  .course-tabs {
    flex-wrap: wrap;
  }

  .course-tab {
    flex: 1 1 45%;
    padding: 10px 12px;
    font-size: 12px;
  }

  .breadcrumbs {
    font-size: 12px;
  }
}
