/* ==========================================================================
   Base CSS - Shared styles for learn.cobavps.com
   Includes: CSS variables, responsive breakpoints, navigation, quiz styles
   ========================================================================== */

/* ==========================================================================
   1. CSS Variables - Light/Dark Themes
   ========================================================================== */

:root {
  /* Light theme (default) */
  --bg: #ffffff;
  --text: #333333;
  --primary: #5277C3;
  --secondary: #7BA0E0;
  --accent: #F5A623;
  --surface: #f5f7fa;
  --code-bg: #1e1e3f;
  --text-on-code: #abb2bf;
  --border: #e0e0e0;
  --shadow: rgba(0, 0, 0, 0.1);
  --success: #4CAF50;
}

[data-theme="dark"] {
  --bg: #1a1a2e;
  --text: #e0e0e0;
  --primary: #7BA0E0;
  --secondary: #5277C3;
  --accent: #F5A623;
  --surface: #16213e;
  --code-bg: #0d0d1a;
  --text-on-code: #abb2bf;
  --border: #2a2a4a;
  --shadow: rgba(0, 0, 0, 0.4);
  --success: #4CAF50;
}

/* ==========================================================================
   2. Responsive Breakpoints (Mobile-First)
   ========================================================================== */

/* Base (mobile < 768px) */
:root {
  --font-size: 16px;
  --padding: 10px;
  --slide-padding: 20px;
  --border-radius: 12px;
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) {
  :root {
    --font-size: 17px;
    --padding: 20px;
    --slide-padding: 30px;
    --border-radius: 16px;
  }
}

/* Desktop (>= 1024px) */
@media (min-width: 1024px) {
  :root {
    --font-size: 18px;
    --padding: 40px;
    --slide-padding: 40px;
    --border-radius: 20px;
  }
}

/* ==========================================================================
   3. Slide Navigation Styles
   ========================================================================== */

.slide-nav {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.slide-nav button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
}

.slide-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mobile (< 480px) - fixed at bottom */
@media (max-width: 480px) {
  .slide-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 10px;
    border-top: 1px solid var(--border);
    background: var(--bg);
  }
}

/* ==========================================================================
   4. Progress Bar and Counter Styles
   ========================================================================== */

.progress-container {
  background: var(--border);
  border-radius: 10px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  background: var(--primary);
  height: 100%;
  transition: width 0.3s ease;
}

.slide-counter {
  font-size: 0.85rem;
  color: var(--text);
  opacity: 0.7;
  text-align: center;
  margin-bottom: 15px;
}

/* ==========================================================================
   5. Header with Breadcrumb and Dark Mode Toggle
   ========================================================================== */

.slide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.7;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1.2rem;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   6. Code Block Copy Button Styles
   ========================================================================== */

pre {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}

.copy-btn.copied {
  background: var(--success);
}

/* ==========================================================================
   7. Body and Presentation Base Styles
   ========================================================================== */

body {
  background: linear-gradient(135deg, var(--bg) 0%, var(--surface) 100%);
  min-height: 100vh;
  color: var(--text);
  font-size: var(--font-size);
}

.presentation {
  max-width: 1000px;
  margin: 0 auto;
}

/* Apply padding from CSS variables */
.slide {
  padding: var(--slide-padding);
  border-radius: var(--border-radius);
  display: none;
}

.slide.active {
  display: block;
}

/* ==========================================================================
   8. Quiz Styles
   ========================================================================== */

.quiz {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  margin-top: 30px;
}

.quiz h3 {
  color: var(--primary);
  margin-bottom: 15px;
}

.question {
  margin-bottom: 20px;
}

.question p {
  margin-bottom: 10px;
  font-weight: 500;
}

.question button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 15px;
  margin-bottom: 8px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s;
}

.question button:hover {
  border-color: var(--primary);
}

.question button.selected {
  border-color: var(--primary);
  background: var(--surface);
}

.question button.correct {
  border-color: var(--success);
  background: rgba(76, 175, 80, 0.1);
}

.question button.incorrect {
  border-color: #f44336;
  background: rgba(244, 67, 54, 0.1);
}

.submit-quiz {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}

/* ==========================================================================
   9. Learning Content Component Styles
   ========================================================================== */

/* Week badges */
.week-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 15px;
}

/* Info and warning boxes */
.info-box {
  background: #e3f2fd;
  border-left: 4px solid var(--primary);
  padding: 15px;
  margin: 15px 0;
  border-radius: 0 8px 8px 0;
}

[data-theme="dark"] .info-box {
  background: rgba(82, 119, 195, 0.15);
}

.warning-box {
  background: #fff3e0;
  border-left: 4px solid var(--accent);
  padding: 15px;
  margin: 15px 0;
  border-radius: 0 8px 8px 0;
}

[data-theme="dark"] .warning-box {
  background: rgba(245, 166, 35, 0.15);
}

/* Highlight text */
.highlight {
  background: linear-gradient(120deg, #f6d365, #fda085);
  padding: 2px 10px;
  border-radius: 4px;
  color: #333;
  font-weight: 500;
}

[data-theme="dark"] .highlight {
  color: #1a1a2e;
}

/* Title slide styling */
.title-slide {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 500px;
}

.title-slide h1 {
  font-size: 3em;
  border: none;
  color: var(--primary);
  margin-bottom: 20px;
}

.title-slide .subtitle {
  font-size: 1.5em;
  color: var(--secondary);
  margin-top: 10px;
}

.title-slide .meta {
  margin-top: 40px;
  color: var(--text);
  opacity: 0.7;
}

/* Navigation buttons */
.btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 15px 40px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  min-height: 44px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--shadow);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Navigation button container (replaces inline slide-nav flex) */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 10px;
}

/* Card component for hub pages */
.card {
  background: var(--surface);
  padding: 30px;
  border-radius: var(--border-radius);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: var(--text);
  border: 3px solid transparent;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px var(--shadow);
}

/* Two-column layout for slides */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* Cheat sheet table */
.cheat-sheet {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

.cheat-sheet th,
.cheat-sheet td {
  padding: 10px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cheat-sheet th {
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
}

.cheat-sheet tr:hover {
  background: var(--surface);
}

/* Checklist component */
.checklist {
  list-style: none;
  padding: 0;
}

.checklist li {
  padding: 8px 0;
  padding-left: 30px;
  position: relative;
}

.checklist li::before {
  content: '☐';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Code inline in text */
p code,
li code {
  background: var(--code-bg);
  color: #98c379;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
}

/* Vertical spacing for headings */
.slide h1 {
  color: var(--primary);
  margin-bottom: 20px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 10px;
}

.slide h2 {
  color: var(--secondary);
  margin: 20px 0 10px;
}

.slide h3 {
  color: var(--text);
  margin: 15px 0 10px;
}

/* Lists in slides */
.slide ul,
.slide ol {
  margin-left: 25px;
  line-height: 1.8;
}

.slide li {
  margin-bottom: 8px;
}

/* Pros/Cons columns */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 15px 0;
}

.pros-cons .pros {
  color: var(--success);
}

.pros-cons .cons {
  color: #f44336;
}

@media (max-width: 600px) {
  .pros-cons {
    grid-template-columns: 1fr;
  }
}
