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

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --bg-primary: #080510;
  --bg-secondary: rgba(18, 12, 28, 0.8);
  --accent-color: #8b0025;
  --accent-hover: #b5002e;
  --accent-light: rgba(139, 0, 37, 0.15);
  --gold: #d4af37;
  --gold-light: rgba(212, 175, 55, 0.15);
  --text-main: #f5f0ff;
  --text-muted: #9b8fac;
  --text-dim: #6b5f7a;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #d4af37;
  --border-color: rgba(212, 175, 55, 0.1);
  --border-active: rgba(212, 175, 55, 0.3);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glow-maroon: 0 0 30px rgba(139, 0, 37, 0.35);
  --glow-gold: 0 0 20px rgba(212, 175, 55, 0.25);
  --shadow-card: 0 8px 40px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.7), 0 4px 16px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ============================================================
   ANIMATED BACKGROUND ORBS
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(139, 0, 37, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat1 18s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(60, 20, 90, 0.18) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat2 22s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(5vw, 8vh) scale(1.15); }
}

@keyframes orbFloat2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-6vw, -5vh) scale(1.2); }
}

/* ============================================================
   PAGE FADE-IN
   ============================================================ */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-enter {
  animation: pageFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.gradient-text {
  background: linear-gradient(135deg, #ffd700 0%, #d4af37 35%, #c09b2a 65%, #9e1b32 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-active), transparent);
  margin-left: 0.5rem;
}

/* ============================================================
   GLASS CARD
   ============================================================ */
.glass-card {
  background: linear-gradient(135deg, rgba(30, 20, 45, 0.75) 0%, rgba(20, 12, 30, 0.85) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
  pointer-events: none;
}

.glass-card:hover {
  border-color: rgba(212, 175, 55, 0.18);
  box-shadow: var(--shadow-elevated), 0 0 40px rgba(139, 0, 37, 0.1);
  transform: translateY(-2px);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
input, textarea, select {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

input::placeholder, textarea::placeholder {
  color: var(--text-dim);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
  background-color: rgba(255, 255, 255, 0.07);
}

select option {
  background: #1a1028;
  color: var(--text-main);
}

/* Range input */
input[type="range"] {
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 99px;
  height: 5px;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
  cursor: pointer;
  transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  font-family: inherit;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.2s;
}

.btn:hover::after {
  background: rgba(255, 255, 255, 0.07);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #8b0025 0%, #6b001c 100%);
  color: #fff;
  box-shadow: var(--glow-maroon), 0 4px 14px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #b5002e 0%, #8b0025 100%);
  box-shadow: 0 0 40px rgba(139, 0, 37, 0.5), 0 6px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-active);
}

.btn-gold {
  background: linear-gradient(135deg, #d4af37 0%, #b8952a 100%);
  color: #1a0a00;
  font-weight: 700;
  box-shadow: var(--glow-gold), 0 4px 14px rgba(0, 0, 0, 0.3);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #f0c84a 0%, #d4af37 100%);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.45), 0 6px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #c62828 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

.btn-icon {
  padding: 0.6rem;
  border-radius: var(--radius-sm);
}

/* ============================================================
   HEADER / NAVBAR
   ============================================================ */
header {
  border-bottom: 1px solid var(--border-color);
  background: rgba(8, 5, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
}

.logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  min-height: calc(100vh - 60px);
  position: relative;
  z-index: 1;
}

.login-box {
  width: 100%;
  max-width: 460px;
}

.login-header {
  text-align: center;
  margin-bottom: 2.25rem;
}

.login-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.35), var(--glow-maroon);
  margin-bottom: 1.25rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
  animation: avatarGlow 3s ease-in-out infinite alternate;
}

@keyframes avatarGlow {
  from { box-shadow: 0 0 20px rgba(212, 175, 55, 0.25), var(--glow-maroon); }
  to   { box-shadow: 0 0 40px rgba(212, 175, 55, 0.5), 0 0 40px rgba(139, 0, 37, 0.45); }
}

.login-header h2 {
  font-size: 1.65rem;
  margin-bottom: 0.3rem;
}

.login-header h3 {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-features {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.login-feat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  font-weight: 500;
}

/* OTP digit-style input */
#otpCode {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.5rem;
  font-family: 'Courier New', monospace;
}

/* ============================================================
   STUDENT DASHBOARD
   ============================================================ */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 2rem;
  width: 100%;
  flex: 1;
  position: relative;
  z-index: 1;
}

.welcome-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.welcome-banner h2 {
  font-size: 1.6rem;
}

.welcome-banner p {
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-size: 0.9rem;
}

/* ============================================================
   VIDEO GRID & CARDS
   ============================================================ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.video-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding: 0;
}

.video-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a0a1e 0%, #0d0a18 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
  position: relative;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.3s, transform 0.4s;
}

.video-thumb-default {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(139, 0, 37, 0.2) 0%, rgba(60, 20, 90, 0.3) 100%);
  font-size: 3rem;
}

.video-play-btn {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(139, 0, 37, 0.9);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(139, 0, 37, 0.6);
  transition: all 0.3s;
  z-index: 2;
}

.video-play-btn svg {
  width: 22px;
  height: 22px;
  fill: #fff;
  margin-left: 3px;
}

.video-card:hover .video-play-btn {
  transform: scale(1.15);
  background: var(--accent-hover);
  box-shadow: 0 0 30px rgba(139, 0, 37, 0.8);
}

.video-card:hover .video-thumb img {
  opacity: 1;
  transform: scale(1.04);
}

.video-info {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.video-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.video-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.limit-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.78rem;
}

.limit-active {
  background-color: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.limit-blocked {
  background-color: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Skeleton loader */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ============================================================
   VIDEO PLAYER
   ============================================================ */
.player-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background-color: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.9), var(--glow-maroon);
}

.player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.watermark {
  position: absolute;
  color: rgba(255, 255, 255, 0.22);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
  font-size: 1rem;
  font-weight: 700;
  pointer-events: none;
  z-index: 9999;
  user-select: none;
  white-space: nowrap;
  background-color: rgba(0, 0, 0, 0.18);
  padding: 4px 12px;
  border-radius: 4px;
  transition: all 0.5s ease-in-out;
}

.player-glass-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 10;
  cursor: pointer;
}

/* Custom controls bar */
.player-controls {
  margin-top: 1rem;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-radius: var(--radius-md);
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.ctrl-btn-primary {
  background: linear-gradient(135deg, #8b0025, #6b001c);
  color: #fff;
  box-shadow: 0 0 12px rgba(139, 0, 37, 0.4);
  min-width: 88px;
}

.ctrl-btn-primary:hover {
  background: linear-gradient(135deg, #b5002e, #8b0025);
  box-shadow: 0 0 20px rgba(139, 0, 37, 0.6);
}

.ctrl-btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.ctrl-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-active);
}

.ctrl-time-display {
  font-size: 0.82rem;
  font-family: 'Courier New', monospace;
  color: var(--text-muted);
  white-space: nowrap;
}

.ctrl-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 200px;
}

.ctrl-speed-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ctrl-speed-wrap label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.ctrl-speed-wrap select {
  width: auto;
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
}

/* Fullscreen */
#playerContainer:fullscreen {
  width: 100vw;
  height: 100vh;
  padding-bottom: 0;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#playerContainer:fullscreen iframe {
  width: 100%;
  height: 100%;
  position: static;
}

#playerContainer:fullscreen .player-glass-overlay {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 65px);
  position: relative;
  z-index: 1;
}

.admin-sidebar {
  border-right: 1px solid var(--border-color);
  background: rgba(10, 6, 18, 0.6);
  backdrop-filter: blur(10px);
  padding: 1.5rem 1rem;
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  overflow-y: auto;
}

.sidebar-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.5rem 0.75rem;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.sidebar-heading:first-child {
  margin-top: 0;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 0.15rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 500;
  font-size: 0.9rem;
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
  border-left-color: var(--gold);
}

.sidebar-nav a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(139, 0, 37, 0.2) 0%, rgba(139, 0, 37, 0.05) 100%);
  border-left-color: var(--accent-color);
}

.sidebar-nav a .nav-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  font-size: 1rem;
  flex-shrink: 0;
  transition: background 0.2s;
}

.sidebar-nav a.active .nav-icon {
  background: rgba(139, 0, 37, 0.3);
}

.sidebar-nav a:hover .nav-icon {
  background: rgba(212, 175, 55, 0.1);
}

.admin-content {
  padding: 2rem;
  overflow-y: auto;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
  animation: pageFadeIn 0.3s ease;
}

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon-maroon { background: rgba(139, 0, 37, 0.2); }
.stat-icon-gold   { background: rgba(212, 175, 55, 0.15); }
.stat-icon-green  { background: rgba(16, 185, 129, 0.15); }
.stat-icon-blue   { background: rgba(59, 130, 246, 0.15); }
.stat-icon-purple { background: rgba(139, 92, 246, 0.15); }

.stat-body {}

.stat-val {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.35rem;
  background: linear-gradient(135deg, #fff 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

th {
  background-color: rgba(255, 255, 255, 0.03);
  padding: 0.9rem 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  font-size: 0.88rem;
  vertical-align: middle;
}

tbody tr {
  transition: background 0.15s;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  width: 100%;
  max-width: 520px;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.close-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  line-height: 1;
}

.close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-success { background: rgba(16, 185, 129, 0.12); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-danger  { background: rgba(239, 68, 68, 0.12);  color: var(--danger);  border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-warning { background: rgba(212, 175, 55, 0.12); color: var(--warning); border: 1px solid rgba(212, 175, 55, 0.2); }
.badge-info    { background: rgba(59, 130, 246, 0.12); color: #60a5fa;        border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-maroon  { background: rgba(139, 0, 37, 0.15);   color: #ff5578;        border: 1px solid rgba(139, 0, 37, 0.3); }

/* ============================================================
   ACTIVITY STREAM
   ============================================================ */
.activity-stream {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.activity-stream::-webkit-scrollbar { width: 4px; }
.activity-stream::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 2px; }

.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-color);
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-time {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

.activity-text {
  line-height: 1.4;
}

/* ============================================================
   WATERMARK DEMO
   ============================================================ */
.watermark-demo {
  position: relative;
  background: linear-gradient(135deg, #0d0a18 0%, #1a0a1e 100%);
  height: 150px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px dashed var(--border-active);
  margin-bottom: 1rem;
}

.watermark-demo-text {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.15);
  font-weight: 700;
  user-select: none;
  transform: rotate(-15deg);
}

/* ============================================================
   ALERT BOX
   ============================================================ */
.alert-box {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  text-align: center;
  display: none;
  border: 1px solid transparent;
  animation: pageFadeIn 0.3s ease;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.25);
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.25);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toastContainer {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  pointer-events: none;
  min-width: 280px;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  animation: toastIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
  max-width: 380px;
  text-align: center;
}

.toast-success { background: rgba(16, 185, 129, 0.9);  color: #fff; border: 1px solid rgba(16, 185, 129, 0.5); }
.toast-error   { background: rgba(239, 68, 68, 0.9);   color: #fff; border: 1px solid rgba(239, 68, 68, 0.5); }
.toast-info    { background: rgba(139, 0, 37, 0.9);    color: #fff; border: 1px solid rgba(139, 0, 37, 0.5); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   DIVIDERS & UTILITY
   ============================================================ */
.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1.5rem 0;
}

.text-muted    { color: var(--text-muted); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }
.text-center   { text-align: center; }
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-1  { margin-bottom: 0.5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex  { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: rgba(8, 5, 16, 0.85);
  backdrop-filter: blur(16px);
  padding: 1.75rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-branding img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.footer-info h4 {
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.15rem;
}

.footer-info p {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--gold);
}

/* ============================================================
   WHATSAPP WIDGET
   ============================================================ */
.whatsapp-widget {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #25D366, #1ea952);
  color: #fff;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35), 0 0 12px rgba(37, 211, 102, 0.4);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.whatsapp-widget:hover {
  transform: scale(1.12) translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.4), 0 0 20px rgba(37, 211, 102, 0.55);
}

.whatsapp-widget::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.4);
  z-index: -1;
  animation: waPulse 2.2s ease-out infinite;
}

@keyframes waPulse {
  0%   { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.65); opacity: 0; }
}

.whatsapp-widget svg {
  width: 30px;
  height: 30px;
  fill: #fff;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .sidebar-nav li {
    margin-bottom: 0;
  }

  .sidebar-nav a {
    padding: 0.5rem 0.75rem;
    border-left: none;
    border-bottom: 2px solid transparent;
  }

  .sidebar-nav a.active {
    border-left: none;
    border-bottom-color: var(--accent-color);
  }

  .sidebar-nav a:hover {
    border-left: none;
    border-bottom-color: var(--gold);
  }

  .sidebar-heading { display: none; }
  .nav-icon { display: none; }

  .admin-content {
    padding: 1.25rem;
  }
}

@media (max-width: 640px) {
  .nav-container {
    padding: 0.75rem 1rem;
  }

  .main-container {
    padding: 1.25rem 1rem;
  }

  .glass-card {
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-val {
    font-size: 1.6rem;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .footer-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .player-controls {
    gap: 0.5rem;
  }

  .ctrl-progress-wrap {
    min-width: 0;
  }

  .welcome-banner h2 {
    font-size: 1.3rem;
  }

  .whatsapp-widget {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
  }
}
