/* ========================================
   BotCamp Training Notebook - Responsive
   Works with layout.css
   ======================================== */

/* ========================================
   DESKTOP (1025px+)
   ======================================== */
@media (min-width: 1025px) {
  .hamburger-btn {
    display: none;
  }

  .sidebar-overlay {
    display: none !important;
  }
}

/* ========================================
   TABLET (769px - 1024px)
   Sidebar as overlay, header simplified
   ======================================== */
@media (max-width: 1024px) {
  .hamburger-btn {
    display: flex;
  }

  .sidebar-overlay {
    display: block;
  }

  /* Hide CTA on tablet */
  .header-cta {
    display: none;
  }

  .current-lesson-badge {
    display: none !important;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.3rem;
  }
}

/* ========================================
   MOBILE (768px and below)
   ======================================== */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 260px;
    --topbar-height: 0px;
  }

  /* Hide top bar on mobile */
  .header-topbar {
    display: none;
  }

  .header-main {
    padding: 0 15px;
  }

  /* AI Disclaimer - mobile friendly */
  .ai-disclaimer {
    padding: 8px 12px;
    font-size: 0.8rem;
    margin-bottom: 15px;
  }

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

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

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.2rem;
    margin-top: 2rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  .card-box {
    padding: 15px;
  }

  .highlight-box {
    padding: 12px 15px;
  }

  .qa-container {
    padding: 15px;
  }

  .table-container {
    margin: 15px -15px;
    padding: 0 15px;
  }

  .table-container th,
  .table-container td {
    padding: 10px 12px;
    font-size: 0.9rem;
  }
}

/* ========================================
   SMALL MOBILE (480px and below)
   ======================================== */
@media (max-width: 480px) {
  :root {
    --sidebar-width: 100%;
    --topbar-height: 0px;
    --header-main-height: 55px;
  }

  /* AI Disclaimer - compact for small screens */
  .ai-disclaimer {
    padding: 6px 10px;
    font-size: 0.75rem;
    gap: 6px;
  }

  .ai-disclaimer-icon {
    font-size: 0.9rem;
  }

  h1 {
    font-size: 1.3rem;
    padding-bottom: 12px;
  }

  h1::after {
    width: 60px;
    height: 4px;
  }

  h2 {
    font-size: 1.1rem;
    padding-inline-start: 12px; /* RTL compatible */
  }

  .concept-item {
    padding-bottom: 12px;
    margin-bottom: 15px;
  }

  .highlight-box {
    padding: 10px 12px;
    margin: 15px 0;
  }

  .debug-step {
    padding: 12px 15px;
  }

  .step-number {
    min-width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .sidebar {
    width: 100%;
    border-inline-end: none; /* RTL compatible */
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  .site-header,
  .sidebar,
  .hamburger-btn,
  .sidebar-overlay,
  .site-footer {
    display: none !important;
  }

  body {
    background: white;
    padding: 0;
    margin: 0;
    max-width: 100%;
    color: black;
    line-height: 1.4;
  }

  .page-wrapper {
    display: block;
  }

  .main-content {
    margin: 0;
    padding: 0;
    max-width: 100%;
  }

  .card-box,
  .highlight-box,
  .qa-container {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    break-after: avoid;
  }

  h2 {
    page-break-before: auto;
    margin-top: 1.5rem;
  }

  .concept-item,
  .qa-container {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  table {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  ul, ol {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  hr {
    page-break-after: avoid;
    break-after: avoid;
  }
}

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

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

  .sidebar {
    transition: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #4338ca;
    --secondary-color: #6d28d9;
    --dark-text: #000000;
    --light-text: #1e293b;
  }

  .card-box,
  .highlight-box,
  .qa-container {
    border-width: 2px;
  }
}
