/* ========================================
   BotCamp Training Notebook - Navigation
   ======================================== */

/* ---- Site Header (wrapper) ---- */
.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: var(--header-height);
  z-index: var(--z-header, 1000);
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Top Utility Bar ---- */
.header-topbar {
  height: var(--topbar-height);
  background: linear-gradient(90deg, #312e81 0%, #5b21b6 40%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 30px;
  flex-shrink: 0;
  overflow: hidden;
  transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.topbar-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
  font-weight: 400;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.topbar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.topbar-link svg {
  opacity: 0.7;
  flex-shrink: 0;
}

.topbar-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

/* WhatsApp link - green accent */
.topbar-whatsapp {
  color: #4ade80;
  font-weight: 500;
}

.topbar-whatsapp svg {
  opacity: 1;
}

.topbar-whatsapp:hover {
  color: #fff;
  background: rgba(74, 222, 128, 0.2);
}

/* ---- Main Header Row ---- */
.header-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 30px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(248, 245, 255, 0.8) 50%,
    rgba(255, 255, 255, 0.88) 100%
  );
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
  box-shadow:
    0 4px 24px rgba(99, 102, 241, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.02);
}

/* Scrolled state */
.site-header.scrolled .header-topbar {
  height: 0;
  overflow: hidden;
  opacity: 0;
}

.site-header.scrolled .header-main {
  box-shadow:
    0 8px 32px rgba(99, 102, 241, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ---- Progress bar ---- */
.header-progress {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: rgba(99, 102, 241, 0.06);
  overflow: hidden;
}

.header-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Logo ---- */
.site-header .logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-header .logo-img {
  height: 52px;
  width: auto;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 2px 6px rgba(99, 102, 241, 0.1));
}

.site-header.scrolled .logo-img {
  height: 46px;
}

.site-header .logo-img:hover {
  transform: scale(1.03) translateY(-1px);
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.18));
}

/* ---- Header Actions (left in RTL) ---- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* CTA Button */
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 24px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.header-cta:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  color: #fff;
}

.header-cta:active {
  transform: translateY(0);
}

.header-cta .cta-arrow {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.header-cta:hover .cta-arrow {
  transform: translateX(-3px);
}

/* ---- Current lesson badge ---- */
.current-lesson-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 50px;
  font-size: 0.82rem;
  color: var(--primary-color);
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: default;
  white-space: nowrap;
}

.current-lesson-badge .badge-icon {
  font-size: 0.95rem;
  animation: pulse-soft 2s ease-in-out infinite;
}

@keyframes pulse-soft {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.current-lesson-badge .badge-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* ---- Hamburger Button ---- */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.hamburger-btn:active {
  transform: scale(0.95);
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 2px 0;
}

.hamburger-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* Sidebar Navigation - Enhanced Glassmorphism */
.sidebar {
  position: fixed;
  top: var(--header-height);
  inset-inline-start: 0; /* RTL: right side */
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.75) 100%
  );
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-inline-end: 1px solid rgba(99, 102, 241, 0.1); /* RTL: left border */
  box-shadow:
    -4px 0 30px rgba(0, 0, 0, 0.03),
    inset 1px 0 0 rgba(255, 255, 255, 0.5);
  overflow-y: auto;
  z-index: var(--z-sidebar, 999);
  padding: 20px 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(99, 102, 241, 0.05);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6366f1, #a855f7);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #4f46e5, #9333ea);
}

/* Sidebar Content */
.sidebar-content {
  padding: 0 15px;
}

.sidebar-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 18px;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.05) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-title::before {
  content: '📚';
  font-size: 1rem;
}

/* Navigation List */
.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin-bottom: 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border-radius: 10px;
  color: var(--dark-text);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-gradient);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.nav-link:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.08) 100%);
  color: var(--primary-color);
  transform: translateX(-3px);
}

.nav-link:hover::before {
  transform: scaleY(1);
}

.nav-link.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.nav-link.active::before {
  display: none;
}

.nav-link .nav-icon {
  margin-left: 10px;
  font-size: 1.1rem;
}

.nav-link .nav-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link .nav-date {
  font-size: 0.75rem;
  color: var(--light-text);
  font-weight: 400;
}

.nav-link.active .nav-date {
  color: rgba(255, 255, 255, 0.8);
}

/* Lesson Submenu */
.lesson-nav {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.lesson-nav-title {
  font-size: 0.8rem;
  color: var(--light-text);
  margin-bottom: 10px;
  padding-right: 10px;
}

.lesson-topics {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

.lesson-topics::before {
  content: '';
  position: absolute;
  right: 12px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.1) 100%);
  border-radius: 1px;
}

.lesson-topic {
  margin-bottom: 2px;
}

.lesson-topic a {
  display: block;
  padding: 8px 15px;
  padding-right: 28px;
  font-size: 0.85rem;
  color: var(--light-text);
  border-radius: 6px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.lesson-topic a::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  transition: all 0.25s ease;
}

.lesson-topic a:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary-color);
  padding-right: 32px;
}

.lesson-topic a:hover::after {
  background: var(--primary-color);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.lesson-topic a.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(168, 85, 247, 0.08) 100%);
  color: var(--primary-color);
  font-weight: 500;
}

.lesson-topic a.active::after {
  background: var(--accent-gradient);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Progress Indicator */
.progress-container {
  padding: 18px;
  margin-top: 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.03) 100%);
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.1);
}

.progress-label {
  font-size: 0.8rem;
  color: var(--light-text);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-label span:first-child {
  font-weight: 600;
  color: var(--dark-text);
}

.progress-percent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.progress-bar {
  height: 8px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Mobile Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-overlay, 998);
  opacity: 0;
  pointer-events: none; /* Prevent clicks when not visible */
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto; /* Allow clicks when visible */
}

/* Footer */
.site-footer {
  padding: 40px 20px;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(99, 102, 241, 0.03) 100%
  );
  border-top: 1px solid rgba(99, 102, 241, 0.1);
  margin-top: 60px;
  position: relative;
  z-index: var(--z-content, 1);
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 0 0 3px 3px;
}

.site-footer .logo-footer {
  margin-bottom: 18px;
}

.site-footer .logo-footer-img {
  height: 56px;
  width: auto;
  opacity: 0.6;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: grayscale(30%);
}

.site-footer .logo-footer-img:hover {
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.05);
}

.site-footer .copyright {
  font-size: 0.85rem;
  color: var(--light-text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.site-footer .copyright::before {
  content: '💜';
  font-size: 0.9rem;
}
