/* ═══════════════════════════════════════════
   CaSamRong Learning — Forest Green Kids Theme
   ═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;600;700;800;900&family=Nunito:wght@400;600;700;800;900&display=swap');

/* ── Palette ── */
:root {
  --green-dark: #145228;
  --green-main: #1B6B35;
  --green-mid: #2E8B57;
  --green-light: #66BB6A;
  --green-pale: #E8F5EC;

  --primary: #1B6B35;
  --primary-light: #2E8B57;
  --secondary: #F4821F;
  /* warm orange accent */
  --accent: #FFD54F;
  /* yellow highlight   */

  --bg: #F0FAF3;
  /* very light mint    */
  --bg-card: #FFFFFF;
  --bg-section: #E4F4EA;

  --text-primary: #0D3320;
  --text-secondary: #2D4A38;
  --text-muted: #6B8F74;

  --border: #A8D5B5;
  --border-light: #D4EDD9;
  --shadow-sm: 0 2px 8px rgba(27, 107, 53, .12);
  --shadow-md: 0 6px 24px rgba(27, 107, 53, .18);
  --shadow-lg: 0 12px 40px rgba(27, 107, 53, .22);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --nav-height: 68px;
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* Subtle green dot background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, #A8D5B5 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  opacity: .40;
  pointer-events: none;
  z-index: 0;
}

* {
  position: relative;
  z-index: 1;
}

h1,
h2,
h3,
h4 {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─────────────────────────────
   NAVBAR
───────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: linear-gradient(135deg, #145228 0%, #1B6B35 55%, #2E8B57 100%);
  box-shadow: 0 4px 20px rgba(20, 82, 40, .4);
  z-index: 1000;
  border-bottom: 3px solid var(--accent);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
  animation: wobble 3s ease-in-out infinite;
}

@keyframes wobble {

  0%,
  100% {
    transform: rotate(-3deg)
  }

  50% {
    transform: rotate(3deg)
  }
}

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

.nav-link {
  color: rgba(255, 255, 255, .9);
  font-size: 14px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 20px;
  transition: all .2s;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, .2);
  color: #fff;
}

.nav-search {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, .18);
  border-radius: 24px;
  padding: 0 6px 0 14px;
  gap: 6px;
  border: 2px solid rgba(255, 255, 255, .3);
  transition: all .2s;
}

.nav-search:focus-within {
  background: #fff;
  border-color: var(--accent);
}

.nav-search input {
  background: none;
  border: none;
  outline: none;
  color: rgba(255, 255, 255, .95);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  width: 160px;
}

.nav-search:focus-within input {
  color: var(--text-primary);
}

.nav-search input::placeholder {
  color: rgba(255, 255, 255, .65);
}

.nav-search:focus-within input::placeholder {
  color: var(--text-muted);
}

.nav-search button {
  background: var(--accent);
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s;
}

.nav-search button:hover {
  transform: scale(1.12);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

.hamburger span {
  width: 24px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
}

/* ─────────────────────────────
   TYPOGRAPHY HELPERS
───────────────────────────── */
.section-eyebrow {
  display: inline-block;
  background: var(--accent);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 16px;
  border-radius: 20px;
  letter-spacing: .5px;
}

.section-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 36px;
  font-weight: 900;
  color: var(--text-primary);
}

.text-gradient {
  background: linear-gradient(135deg, var(--secondary), var(--green-main));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─────────────────────────────
   CATEGORY CARDS (large)
───────────────────────────── */
.category-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 16px 22px;
  text-align: center;
  border: 3px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: all .22s cubic-bezier(.34, 1.56, .64, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.category-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: var(--shadow-lg);
  border-color: var(--green-light);
}

.cat-icon {
  line-height: 1;
  transition: transform .3s;
}

.category-card:hover .cat-icon {
  transform: scale(1.2) rotate(5deg);
}

.cat-name {
  font-family: 'Baloo 2', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.cat-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
}

.cat-pill {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
}

/* ─────────────────────────────
   VIDEO GRID & CARD
───────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.video-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border-light);
  transition: all .22s cubic-bezier(.34, 1.56, .64, 1);
  cursor: pointer;
  display: block;
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-light);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-section);
  overflow: hidden;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.video-card:hover .video-thumb img {
  transform: scale(1.06);
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(27, 107, 53, .28);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}

.video-card:hover .play-overlay {
  opacity: 1;
}

.play-btn {
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
  transform: scale(.85);
  transition: transform .2s;
}

.video-card:hover .play-btn {
  transform: scale(1);
}

.video-body {
  padding: 10px 12px 12px;
}

.video-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
  line-height: 1.4;
  margin-bottom: 6px;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.cat-badge-sm {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-section);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}

/* ─────────────────────────────
   PLAYER PAGE
───────────────────────────── */
.player-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.video-embed-wrap {
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16/9;
  box-shadow: var(--shadow-md);
}

.video-embed-wrap iframe,
.video-embed-wrap #yt-player {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

.video-info-block {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border-light);
}

.video-info-block h1 {
  font-size: 20px;
  line-height: 1.35;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.tag {
  display: inline-block;
  background: var(--bg-section);
  color: var(--primary);
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  margin: 2px;
}

.sidebar-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 4px;
}

.related-list::-webkit-scrollbar {
  width: 4px;
}

.related-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.related-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 8px;
  border: 2px solid var(--border-light);
  transition: all .18s;
  cursor: pointer;
}

.related-item:hover {
  border-color: var(--green-light);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
}

.related-thumb {
  width: 96px;
  flex-shrink: 0;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-section);
  position: relative;
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-info {
  flex: 1;
  min-width: 0;
}

.related-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.related-views {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ─────────────────────────────
   BUTTONS
───────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 24px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(27, 107, 53, .35);
}

.btn-primary:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27, 107, 53, .45);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
  box-shadow: 0 4px 14px rgba(244, 130, 31, .3);
}

.btn-secondary:hover {
  opacity: .9;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: var(--bg-section);
}

.btn-ghost {
  background: var(--bg-section);
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--border);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 16px;
}

/* ─────────────────────────────
   MISCELLANEOUS
───────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-section);
  color: var(--text-secondary);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--primary);
  font-weight: 700;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .sep {
  color: var(--border);
  font-size: 16px;
}

input,
select,
textarea {
  font-family: 'Nunito', sans-serif;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
}

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 12px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 14px;
  animation: bounce 1.4s ease-in-out infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-12px)
  }
}

.empty-state h3 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 20px;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
}

#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
  animation: slideUp .3s ease;
  white-space: nowrap;
}

@keyframes slideUp {
  from {
    transform: translateY(12px);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}

.toast.success {
  background: var(--green-main);
}

.toast.error {
  background: #E53935;
}

.toast.info {
  background: var(--primary);
}

/* ─────────────────────────────
   FOOTER
───────────────────────────── */
footer {
  background: linear-gradient(135deg, #145228, #1B6B35);
  color: rgba(255, 255, 255, .9);
  padding: 24px 0;
  border-top: 4px solid var(--accent);
  margin-top: 60px;
}

.footer-bottom {
  text-align: center;
}

.footer-bottom a {
  color: var(--accent);
  font-weight: 700;
}

.footer-bottom a:hover {
  text-decoration: underline;
}

/* ─────────────────────────────
   ADMIN PANEL
───────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  min-height: 100vh;
  background: linear-gradient(180deg, #145228 0%, #1B6B35 100%);
  padding: 24px 0;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 4px 0 20px rgba(20, 82, 40, .25);
}

.admin-sidebar .logo {
  font-family: 'Baloo 2', sans-serif;
  font-size: 20px;
  font-weight: 900;
  padding: 0 20px 20px;
  border-bottom: 2px solid rgba(255, 255, 255, .15);
  color: var(--accent);
}

.sidebar-item {
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: rgba(255, 255, 255, .8);
  transition: all .2s;
  border-left: 4px solid transparent;
}

.sidebar-item:hover,
.sidebar-item.active {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-left-color: var(--accent);
}

.admin-content {
  flex: 1;
  padding: 28px;
  background: var(--bg);
  overflow-x: auto;
}

.admin-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border-light);
  margin-bottom: 20px;
}

.admin-card h2 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-box {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-box .num {
  font-family: 'Baloo 2', sans-serif;
  font-size: 32px;
  font-weight: 900;
}

.stat-box .lbl {
  font-size: 12px;
  opacity: .85;
  font-weight: 700;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: var(--bg-section);
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background: var(--bg-section);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 82, 40, .35);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(20, 82, 40, .22);
  border: 3px solid var(--border-light);
}

.modal h3 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #E8F5EC 0%, #A8D5B5 100%);
}

.login-box {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(27, 107, 53, .18);
  border: 3px solid var(--border);
}

.login-box h2 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 26px;
  font-weight: 900;
  margin: 16px 0 6px;
  color: var(--text-primary);
}

.login-box p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ─────────────────────────────
   RESPONSIVE
───────────────────────────── */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: #1B6B35;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    z-index: 999;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-search {
    display: none;
  }

  .player-layout {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 26px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    min-height: auto;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .container {
    padding: 0 12px;
  }
}

