/* Sidebar logo */
.sidebar-logo {
  max-width: 36px;
  margin: 0;
}

/* Hero section */
.hero {
  padding: 1rem 1rem 0.8rem;
  text-align: center;
  background: linear-gradient(135deg, #1a237e 0%, #283593 30%, #00695c 100%);
  color: white;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.15rem;
  letter-spacing: -0.02em;
  color: white;
}

.hero p {
  font-size: 0.82rem;
  opacity: 0.9;
  max-width: 500px;
  margin: 0 auto 0.4rem;
  color: white;
  line-height: 1.4;
}

.hero .hero-badges {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.hero .hero-badges a img {
  height: 24px;
}

/* Stats bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 1.5rem;
  background: var(--color-background-secondary, #f5f5f5);
  border-radius: 10px;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat .number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-brand-primary, #3f51b5);
  display: block;
}

.stat .label {
  font-size: 0.85rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Track cards */
.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.track-card {
  border: 1px solid var(--color-background-border, #e0e0e0);
  border-radius: 10px;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--color-background-secondary, #f5f5f5);
}

.track-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.track-card h3 {
  margin-top: 0;
  color: var(--color-brand-primary, #3f51b5);
}

.track-card .duration {
  display: inline-block;
  background: var(--color-brand-primary, #3f51b5);
  color: white;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Phase grid */
.phase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.phase-card {
  display: block;
  padding: 1rem 1.2rem;
  border: 1px solid var(--color-background-border, #e0e0e0);
  border-radius: 8px;
  text-decoration: none !important;
  color: var(--color-foreground-primary) !important;
  transition: all 0.2s;
  background: var(--color-background-secondary, #f5f5f5);
}

.phase-card:hover {
  border-color: var(--color-brand-primary, #3f51b5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.phase-card .phase-number {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-brand-primary, #3f51b5);
  letter-spacing: 0.05em;
}

.phase-card .phase-title {
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Section headers on homepage */
.section-header {
  text-align: center;
  margin: 3rem 0 1.5rem;
}

.section-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
}

.section-header p {
  opacity: 0.7;
  max-width: 500px;
  margin: 0 auto;
}

/* Notebook launcher bar */
.notebook-launchers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(0, 105, 92, 0.18);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(26, 35, 126, 0.06), rgba(0, 105, 92, 0.08));
}

.notebook-launchers__label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-foreground-primary);
}

.notebook-launchers__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.notebook-launchers__link:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  opacity: 0.95;
}

.notebook-launchers__link--colab {
  background: #f9ab00;
  color: #202124 !important;
}

.notebook-launchers__icon {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}

.notebook-launchers__link--kaggle {
  background: #20beff;
  color: #06263a !important;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .stats-bar {
    gap: 1.5rem;
  }

  .stat .number {
    font-size: 1.5rem;
  }
}

/* Dark mode tweaks */
body[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #0d1b4a 0%, #1b2d6b 30%, #004d40 100%);
}

body[data-theme="dark"] .track-card,
body[data-theme="dark"] .phase-card {
  border-color: rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .notebook-launchers {
  border-color: rgba(32, 190, 255, 0.22);
  background: linear-gradient(135deg, rgba(15, 27, 74, 0.55), rgba(0, 77, 64, 0.35));
}

body[data-theme="dark"] .notebook-launchers__label {
  color: rgba(255, 255, 255, 0.92);
}

/* ================================================================
   Datadog-style draggable sidebar resize handles
   ================================================================ */

/* The thin drag handle bar */
.sidebar-resize-handle {
  display: none;               /* shown only at desktop widths */
  position: absolute;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  z-index: 36;
  background: transparent;
  transition: background 0.15s;
}

.sidebar-resize-handle::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-background-border, #e0e0e0);
  transition: width 0.15s, background 0.15s;
}

.sidebar-resize-handle:hover::after,
.sidebar-resizing .sidebar-resize-handle::after {
  width: 3px;
  background: var(--color-brand-primary, #3f51b5);
}

/* Left handle: sits on the right edge of .sidebar-drawer */
.sidebar-resize-handle--left {
  right: -3px;
}
.sidebar-resize-handle--left::after {
  right: 0;
}

/* Right handle: sits on the left edge of .toc-drawer */
.sidebar-resize-handle--right {
  left: -3px;
}
.sidebar-resize-handle--right::after {
  left: 0;
}

/* Prevent text selection & pointer events while dragging */
body.sidebar-resizing {
  user-select: none;
  -webkit-user-select: none;
  cursor: col-resize !important;
}
body.sidebar-resizing * {
  cursor: col-resize !important;
}

/* Desktop only: enable handles & collapse behaviour */
@media (min-width: 63em) {
  .sidebar-resize-handle {
    display: block;
  }

  /* Allow the drawers to receive custom widths from JS */
  .sidebar-drawer {
    position: relative;          /* anchor for the handle */
    transition: min-width 0.2s ease, width 0.2s ease, opacity 0.15s ease;
    overflow: hidden;
  }

  .toc-drawer {
    position: relative;
    transition: width 0.2s ease, opacity 0.15s ease, padding 0.2s ease;
    overflow: hidden;
  }

  /* Disable transitions while dragging (instant feedback) */
  body.sidebar-resizing .sidebar-drawer,
  body.sidebar-resizing .toc-drawer {
    transition: none !important;
  }

  /* Left sidebar collapsed */
  body.sidebar-left-collapsed .sidebar-drawer {
    min-width: 0 !important;
    width: 0 !important;
    opacity: 0;
    pointer-events: none;
  }

  /* Right sidebar collapsed */
  body.sidebar-right-collapsed .toc-drawer {
    width: 0 !important;
    padding: 0 !important;
    opacity: 0;
    pointer-events: none;
  }

  /* Widen content when sidebars are collapsed */
  body.sidebar-left-collapsed .content,
  body.sidebar-right-collapsed .content {
    max-width: none;
  }

  /* --- Expand tabs: visible only when the sidebar is collapsed --- */
  .sidebar-expand-tab {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 38;
    width: 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--color-background-border, #e0e0e0);
    background: var(--color-background-secondary, #f8f9fb);
    color: var(--color-foreground-muted, #6b6f76);
    font-size: 13px;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, background 0.15s, color 0.15s;
  }
  .sidebar-expand-tab:hover {
    background: var(--color-background-hover, #efeff4);
    color: var(--color-brand-primary, #3f51b5);
  }

  .sidebar-expand-tab--left {
    left: 0;
    border-left: none;
    border-radius: 0 6px 6px 0;
  }
  .sidebar-expand-tab--right {
    right: 0;
    border-right: none;
    border-radius: 6px 0 0 6px;
  }

  /* Show expand tab only when corresponding sidebar is collapsed */
  body.sidebar-left-collapsed .sidebar-expand-tab--left {
    opacity: 1;
    pointer-events: auto;
  }
  body.sidebar-right-collapsed .sidebar-expand-tab--right {
    opacity: 1;
    pointer-events: auto;
  }

  /* Let the main content area grow to fill space freed by resized sidebars */
  .main {
    display: flex;
  }

  .content {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
  }

  /* Keep the sidebar-drawer from being forced wide by flex */
  .sidebar-drawer {
    flex-shrink: 0;
  }
  .toc-drawer {
    flex-shrink: 0;
  }
}

/* Hide handles on mobile — Furo handles mobile sidebars */
@media (max-width: 63em) {
  .sidebar-resize-handle {
    display: none !important;
  }
}
