/* =========================
   BODY
========================== */

body {
  background-color: #0f172a;
  font-family: 'Segoe UI', Roboto, sans-serif;
  color: #f8fafc;

  min-height: 100vh;
  display: flex;
  flex-direction: column;

  margin: 0;
  overflow-x: hidden;
}

/* =========================
   NAVBAR
========================== */

.navbar {
  background: rgba(15, 23, 42, 0.8) !important;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border-bottom: 1px solid rgba(255,255,255,0.05);

  padding: 12px 24px;

  box-shadow:
    0 1px 0 rgba(255,255,255,0.03),
    0 10px 30px rgba(0,0,0,0.2);
}

.navbar-brand {
  color: #38bdf8 !important;
  font-weight: 700;
}

.nav-link {
  color: #cbd5e1 !important;
}

/* =========================
   GRID
========================== */

#thumbnails {

  display: flex;
  flex-wrap: wrap;

  justify-content: center;

  gap: 24px;

  padding: 24px;
}

/* =========================
   CARD
========================== */

.card {

  background: #1e293b !important;

  border:
    1px solid rgba(255,255,255,0.05) !important;

  border-radius: 16px !important;

  overflow: hidden;

  flex: 0 1 100%;

  min-width: 280px;
  max-width: 360px;

  transition:
    transform .25s ease,
    border-color .25s ease,
    box-shadow .25s ease;

  box-shadow:
    0 10px 25px rgba(0,0,0,0.25);
}

.card:hover {

  transform: translateY(-4px);

  border-color:
    rgba(56,189,248,0.4) !important;

  box-shadow:
    0 15px 35px rgba(0,0,0,0.35),
    0 0 0 1px rgba(56,189,248,0.15);
}

/* =========================
   RESPONSIVE
========================== */

@media (min-width: 768px) {

  .card {
    flex: 0 1 calc(50% - 12px);
  }

}

@media (min-width: 1024px) {

  .card {
    flex: 0 1 calc(33.33% - 16px);
  }

}

/* =========================
   THUMBNAIL
========================== */

.thumbnail-wrapper {
  position: relative;

  width: 100%;

  aspect-ratio: 16 / 9;

  background: black;

  overflow: hidden;



}

.thumbnail {

  position: absolute;

  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: cover;

  cursor: pointer;

  transition: transform .3s ease;

  -webkit-tap-highlight-color: transparent;
}

.thumbnail:hover {
  transform: scale(1.02);
}

/* =========================
   LIVE BADGE
========================== */

.live-badge {

  position: absolute;

  top: 8px;
  right: 8px;

  z-index: 2;

  background: #10b981;

  color: white;

  font-size: 10px;

  font-weight: 700;

  padding: 4px 8px;

  border-radius: 999px;
}

/* =========================
   CARD BODY
========================== */

.card-body {

  background: white !important;

  padding: 14px 12px !important;

  text-align: center;
}

.card-title {

  color: #0f172a !important;

  font-size: 14px;

  font-weight: 700;

  margin-bottom: 6px;
}

.snapshot-time {

  color: #64748b;

  font-size: 11px;

  font-weight: 500;
}

/* =========================
   VIDEO PLAYER
========================== */

.video-player {

  position: fixed;

  inset: 0;

  background:
    rgba(0,0,0,0.92);

  backdrop-filter: blur(4px);

  display: flex;
  justify-content: center;
  align-items: center;

  z-index: 9999;

  opacity: 0;

  pointer-events: none;

  transition: opacity .25s ease;
}

.video-player.active {

  opacity: 1;

  pointer-events: auto;
}

.video-player video {

  width: 92%;

  max-width: 1300px;

  max-height: 90vh;

  border-radius: 16px;

  background: black;

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05),
    0 20px 50px rgba(0,0,0,0.6);
}

/* =========================
   CLOSE BUTTON
========================== */

.close-btn {

  position: absolute;

  top: 16px;
  right: 20px;

  width: 42px;
  height: 42px;

  border-radius: 50%;

  background:
    rgba(255,255,255,0.12);

  display: flex;
  justify-content: center;
  align-items: center;

  font-size: 20px;

  color: white;

  cursor: pointer;

  transition: .2s ease;
}

.close-btn:hover {

  background:
    rgba(255,255,255,0.2);

  transform: scale(1.05);
}

/* =========================
   LOADING SPINNER
========================== */

.loading-spinner {

  width: 60px;
  height: 60px;

  border:
    4px solid rgba(255,255,255,0.2);

  border-top-color: white;

  border-radius: 50%;

  animation: spin 1s linear infinite;

  position: absolute;
}

@keyframes spin {

  to {
    transform: rotate(360deg);
  }

}

/* =========================
   FOOTER
========================== */

footer {

  margin-top: auto;

  background: #0b1120;

  border-top:
    1px solid rgba(255,255,255,0.05);

  padding: 20px;

  text-align: center;

  color: #64748b;
}

footer a {

  color: #38bdf8;

  text-decoration: none;
}

/* =========================
   THEME VARIABLES
========================== */

:root {

  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --bg-navbar: rgba(255,255,255,0.8);

  --text-main: #0f172a;
  --text-secondary: #475569;

  --border-color: rgba(0,0,0,0.08);

  --shadow:
    0 10px 30px rgba(0,0,0,0.08);

}

/* =========================
   DARK MODE
========================== */

body.dark-mode {

  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-navbar: rgba(15,23,42,0.8);

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;

  --border-color: rgba(255,255,255,0.05);

  --shadow:
    0 10px 30px rgba(0,0,0,0.3);
}

/* =========================
   APPLY VARIABLES
========================== */

body {

  background: var(--bg-main);

  color: var(--text-main);

  transition:
    background .3s ease,
    color .3s ease;
}

.navbar {

  background:
    var(--bg-navbar) !important;

  border-bottom:
    1px solid var(--border-color);
}

.card {

  background:
    var(--bg-card) !important;

  border:
    1px solid var(--border-color) !important;

  box-shadow:
    var(--shadow);
}

.card-body {

  background:
    var(--bg-card) !important;
}

.card-title {

  color:
    var(--text-main) !important;
}

.snapshot-time {

  color:
    var(--text-secondary) !important;
}

footer {

  background:
    var(--bg-card);

  color:
    var(--text-secondary);
}

/* =========================
   THEME BUTTON
========================== */

.theme-toggle-btn {

  width: 42px;
  height: 42px;

  border: none;

  border-radius: 50%;

  background:
    rgba(56,189,248,0.15);

  color: white;

  font-size: 18px;

  cursor: pointer;

  transition: .25s ease;

  display: flex;
  justify-content: center;
  align-items: center;
}

.theme-toggle-btn:hover {

  transform: scale(1.08);

  background:
    rgba(56,189,248,0.25);
}

/* =========================
   LIGHT MODE TEXT FIX
========================== */

body:not(.dark-mode) .navbar-brand {

  color: #0284c7 !important;
}

body:not(.dark-mode) .nav-link {

  color: #334155 !important;
}

body:not(.dark-mode) .theme-toggle-btn {

  color: #0f172a;

  background:
    rgba(15,23,42,0.08);
}

body:not(.dark-mode) .video-player {

  background:
    rgba(255,255,255,0.9);
}

html {

  color-scheme:
    light dark;

}

/* =========================
   FLOATING THEME BUTTON
========================== */

.theme-floating-btn {

  position: fixed;

  right: 20px;
  bottom: 20px;

  width: 58px;
  height: 58px;

  border: none;

  border-radius: 50%;

  background:
    rgba(56,189,248,0.18);

  backdrop-filter: blur(10px);

  -webkit-backdrop-filter: blur(10px);

  color: white;

  font-size: 24px;

  display: flex;
  justify-content: center;
  align-items: center;

  cursor: pointer;

  z-index: 99999;

  transition:
    transform .25s ease,
    background .25s ease,
    box-shadow .25s ease;

  box-shadow:
    0 10px 25px rgba(0,0,0,0.25);

  -webkit-tap-highlight-color: transparent;
}

/* HOVER */

.theme-floating-btn:hover {

  transform:
    scale(1.08);

  background:
    rgba(56,189,248,0.3);

  box-shadow:
    0 15px 35px rgba(0,0,0,0.35);
}

/* ACTIVE TAP */

.theme-floating-btn:active {

  transform:
    scale(0.96);
}

/* LIGHT MODE */

body:not(.dark-mode)
.theme-floating-btn {

  background:
    rgba(15,23,42,0.08);

  color:
    #0f172a;
}

/* MOBILE */

@media (max-width: 768px) {

  .theme-floating-btn {

    width: 54px;
    height: 54px;

    right: 16px;
    bottom: 16px;

    font-size: 22px;
  }

}