@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

:root {
  /* EDPUZZLE & IBN LEARN COLORFUL BRIGHT PALETTE */
  --bg-main: #f1f5f9;
  --bg-subtle: #e2e8f0;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  
  --border-color: #e2e8f0;
  --border-accent: #cbd5e1;
  --border-primary: rgba(79, 70, 229, 0.4);

  /* BRAND ACCENTS */
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #eef2ff;
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-cyan: #0284c7;
  --accent-emerald: #059669;
  --accent-amber: #f59e0b;
  --accent-rose: #e11d48;
  
  /* TYPOGRAPHY COLORS */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 18px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 30px -4px rgba(15, 23, 42, 0.15);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.25);

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(245, 158, 11, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--accent-blue);
}

/* Navbar Modern Colorful Gradient */
.navbar {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  border-bottom: 2px solid rgba(99, 102, 241, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.85rem 0;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
}

.container {
  width: 94%;
  max-width: 1240px;
  margin: 0 auto;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #ffffff;
  letter-spacing: -0.5px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}

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

.nav-tab {
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.875rem;
  color: #94a3b8;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-tab.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.badge-success {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.badge-info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.badge-warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* Cards & Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-md);
  position: relative;
}

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

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 1rem;
  border: 1px solid rgba(0, 184, 169, 0.25);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Form Inputs */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 184, 169, 0.18);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border-color);
  color: var(--text-muted);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-accent);
}

.btn-danger {
  background: #ef4444;
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Tables */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; margin-top: 0.75rem; font-size: 0.9rem; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border-color); }
.table th { background: var(--bg-subtle); color: var(--text-muted); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; }

/* EDPUZZLE SPECIFIC SIDE-BY-SIDE LAYOUT STYLES */
.edpuzzle-play-container {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.25rem;
  align-items: start;
  margin-top: 0.75rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 991px) {
  .edpuzzle-play-container {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

/* Video Control Bar External (Di Luar Player) */
.edpuzzle-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: 0 0 12px 12px;
  border: 1px solid var(--border-color);
  border-top: none;
  margin-top: -4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.control-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.control-btn:hover {
  background: var(--bg-subtle);
  color: var(--accent-blue);
}

/* Scrub Bar & Checkpoint Pins */
.timeline-container {
  flex: 1;
  min-width: 0; /* Fix flexbox shrink overflow bug on mobile */
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.timeline-track {
  width: 100%;
  height: 6px;
  background: #cbd5e1;
  border-radius: 3px;
  position: relative;
  overflow: visible;
}

.timeline-progress {
  height: 100%;
  background: var(--accent-blue);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

/* Pin Teardrop / Circle Checkpoint Marker (Tepat di atas garis durasi) */
.timeline-pin {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s ease, background 0.2s ease;
}

.timeline-pin::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px 4px 0 4px;
  border-style: solid;
  border-color: #2563eb transparent transparent transparent;
}

.timeline-pin:hover {
  transform: translate(-50%, -50%) scale(1.35);
}

.timeline-pin.answered {
  background: #059669;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.4);
}

.timeline-pin.answered::after {
  border-color: #059669 transparent transparent transparent;
}

.time-display {
  font-size: 0.75rem;
  font-family: 'Fira Code', monospace;
  color: var(--text-muted);
  min-width: 75px;
  text-align: center;
  flex-shrink: 0;
}

/* Mobile Responsive Optimizations for Video Player & Controls */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

/* Navbar Dropdown Visibility & Stacking Safety */
.navbar, .navbar .container, .nav-content, .nav-badges {
  overflow: visible !important;
}

@media (max-width: 768px) {
  .navbar .container {
    overflow: visible !important;
  }

  .container {
    width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box !important;
    max-width: 100vw !important;
  }

  .nav-content {
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }

  .nav-badges {
    flex-wrap: nowrap !important;
    gap: 6px !important;
    max-width: 100% !important;
  }

  #notifDropdownMenu, #profileDropdownMenu {
    position: fixed !important;
    top: 58px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.4) !important;
    z-index: 9999999 !important;
  }

  .card {
    padding: 12px !important;
    border-radius: 16px !important;
    margin-bottom: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .edpuzzle-controls {
    gap: 6px !important;
    padding: 8px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .control-btn {
    padding: 4px 6px !important;
    font-size: 0.95rem !important;
  }

  .time-display {
    font-size: 0.7rem !important;
    min-width: 65px !important;
  }
}

@media (max-width: 480px) {
  .edpuzzle-controls {
    gap: 4px !important;
    padding: 6px 6px !important;
  }

  .control-btn {
    padding: 3px 5px !important;
    font-size: 0.85rem !important;
  }

  .hide-on-mobile {
    display: none !important;
  }

  .time-display {
    font-size: 0.65rem !important;
    min-width: 55px !important;
  }
}

/* Right Side Question Card Box */
.edpuzzle-quiz-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.quiz-type-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
}

.quiz-type-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--accent-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.quiz-type-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

/* Opsi Jawaban Kuis Interaktif */
.quiz-option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 8px;
  user-select: none;
}

.quiz-option-label:hover {
  background: var(--bg-subtle);
  border-color: var(--border-accent);
}

.quiz-option-label.selected {
  background: #eff6ff !important;
  border: 2px solid #2563eb !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.quiz-option-label.selected span {
  color: #1d4ed8 !important;
  font-weight: 700 !important;
}

.quiz-option-label input[type="radio"] {
  accent-color: var(--accent-blue);
  transform: scale(1.25);
  cursor: pointer;
}

/* Footer */
footer {
  margin-top: auto;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: #ffffff;
}
