/* =============================================
   UNLOCKVID - Main Stylesheet
   Mobile-First | Glassmorphism | Dark Theme
   ============================================= */

:root {
  color-scheme: dark;
  --bg-primary:    #0a0a0c;
  --bg-secondary:  #141417;
  --bg-card:       rgba(255,255,255,0.06);
  --bg-glass:      rgba(15,15,18,0.55);
  --bg-glass-heavy:rgba(10,10,12,0.85);
  --red:           #ff2a2a;
  --red-dark:      #cc0000;
  --red-glow:      rgba(255,42,42,0.25);
  --red-glow2:     rgba(255,42,42,0.08);
  --text-primary:  #ffffff;
  --text-secondary:#a0a0a0;
  --text-muted:    #65656c;
  --border:        rgba(255,255,255,0.07);
  --border-glass:  rgba(255,255,255,0.12);
  --border-red:    rgba(255,42,42,0.3);
  --radius:        18px;
  --radius-sm:     12px;
  --radius-full:   50px;
  --shadow:        0 8px 32px rgba(0,0,0,0.6);
  --shadow-red:    0 4px 20px rgba(255,42,42,0.3);
  --transition:    0.3s cubic-bezier(0.4,0,0.2,1);
  --nav-height:    65px;
  --header-height: 56px;
  --font:          "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; overscroll-behavior-y: none; }

/* Ambient Glow for Glassmorphism */
body::before {
  content: ''; position: fixed; top: -15%; left: -15%; width: 80vw; height: 80vw;
  background: radial-gradient(circle, rgba(255,42,42,0.18) 0%, transparent 60%);
  filter: blur(80px); z-index: -1; pointer-events: none;
}
body::after {
  content: ''; position: fixed; bottom: -10%; right: -15%; width: 70vw; height: 70vw;
  background: radial-gradient(circle, rgba(80,42,255,0.12) 0%, transparent 60%);
  filter: blur(80px); z-index: -1; pointer-events: none;
}
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  width: 100vw;
  max-width: 100vw;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
}
img { max-width: 100%; display: block; }
a  { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; border: none; outline: none; }
input, textarea, select { font-family: var(--font); outline: none; border: none; }
ul { list-style: none; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 0px; height: 0px; display: none; }
::-webkit-scrollbar-track { background: transparent; display: none; }
::-webkit-scrollbar-thumb { background: transparent; display: none; }

/* =============================================
   TOP HEADER
   ============================================= */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-height);
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
}
.header-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.15rem; font-weight: 800; letter-spacing: -0.5px;
}
.header-logo .logo-icon {
  width: 32px; height: 32px; background: var(--red);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-red);
}
.header-logo .logo-icon svg { width: 18px; height: 18px; fill: #fff; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-credits {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-card); border: 1px solid var(--border-red);
  border-radius: var(--radius-full); padding: 5px 12px;
  font-size: 0.8rem; font-weight: 700; color: var(--red);
  text-decoration: none;
}
.header-credits svg { width: 14px; height: 14px; fill: var(--red); }
.header-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: var(--transition);
}
.header-btn:hover, .header-btn.active { border-color: var(--red); color: var(--red); }
.header-btn svg { width: 18px; height: 18px; }

.main-content { padding-top: calc(var(--header-height) + 8px); }

/* =============================================
   BOTTOM NAVIGATION
   ============================================= */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  user-select: none;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 6px 4px; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none;
  transition: var(--transition); font-size: 0.68rem; font-weight: 500;
  position: relative;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--red); }
.nav-item.active::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 2px; background: var(--red); border-radius: 2px;
}
.nav-item:active { transform: scale(0.92); }

/* =============================================
   SEARCH BAR
   ============================================= */
.search-bar { backdrop-filter: blur(12px) saturate(180%); -webkit-backdrop-filter: blur(12px) saturate(180%); border-color: var(--border-glass); 
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: 10px 16px;
  transition: var(--transition);
}
.search-bar:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow2); }
.search-bar svg { width: 17px; height: 17px; fill: var(--text-muted); flex-shrink: 0; }
.search-bar input {
  flex: 1; background: transparent; color: var(--text-primary);
  font-size: 0.9rem; min-width: 0;
}
.search-bar input::placeholder { color: var(--text-muted); }

/* =============================================
   SECTION HEADERS
   ============================================= */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 16px 10px;
}
.section-title {
  font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.badge-free  { background: rgba(0,200,100,0.15); color: #00c864; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); border: 1px solid rgba(0,200,100,0.3); }
.badge-premium { background: rgba(255,42,42,0.15); color: var(--red); font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); border: 1px solid var(--border-red); }
.section-link { font-size: 0.8rem; color: var(--red); font-weight: 500; }

/* =============================================
   VIDEO CARDS
   ============================================= */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 12px 8px;
}
.video-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.video-card:active { transform: scale(0.97); }
.video-card:hover { border-color: var(--border-red); }

.video-thumb {
  position: relative; padding-top: 56.25%; overflow: hidden; background: #1a1a1a;
}
.video-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.video-card:hover .video-thumb img { transform: scale(1.05); }

/* Premium blur overlay */
.video-thumb.is-premium .thumb-img { filter: blur(8px); transform: scale(1.05); }
.premium-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 8px;
}
.premium-overlay .lock-icon { font-size: 1.5rem; }
.premium-overlay .premium-label { font-size: 0.72rem; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.premium-overlay .unlock-btn {
  background: var(--red); color: #fff;
  border-radius: var(--radius-full); padding: 5px 12px;
  font-size: 0.7rem; font-weight: 700; border: none; cursor: pointer;
  white-space: nowrap; display: flex; align-items: center; gap: 4px;
  transition: var(--transition);
}
.premium-overlay .unlock-btn:hover { background: var(--red-dark); }

/* Play button */
.play-btn {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: var(--transition);
}
.video-card:hover .play-btn, .video-thumb:active .play-btn { opacity: 1; }
.play-btn-circle {
  width: 44px; height: 44px; background: rgba(255,42,42,0.9);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-red);
}
.play-btn-circle svg { width: 20px; height: 20px; fill: #fff; margin-left: 2px; }

/* Duration badge */
.duration-badge {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,0.8); color: #fff;
  font-size: 0.65rem; font-weight: 600; padding: 2px 6px; border-radius: 4px;
}
.type-badge {
  position: absolute; top: 6px; left: 6px;
  font-size: 0.62rem; font-weight: 700; padding: 2px 7px; border-radius: var(--radius-full);
}
.type-badge.free  { background: rgba(0,200,100,0.85); color: #fff; }
.type-badge.premium { background: rgba(255,42,42,0.85); color: #fff; }

/* Card body */
.video-info { padding: 10px; }
.video-title { font-size: 0.82rem; font-weight: 600; line-height: 1.35; margin-bottom: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); }
.video-meta-left { display: flex; align-items: center; gap: 8px; }
.video-stat { display: flex; align-items: center; gap: 3px; }
.video-stat svg { width: 11px; height: 11px; fill: currentColor; }

/* Horizontal scroll cards */
.video-scroll {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 12px 8px; -webkit-overflow-scrolling: touch;
}
.video-scroll::-webkit-scrollbar { width: 0px; height: 0px; display: none; }
.video-scroll .video-card { flex: 0 0 160px; scroll-snap-align: start; }
.video-scroll .video-thumb { padding-top: 60%; }

/* =============================================
   HERO / FEATURED VIDEO
   ============================================= */
.hero-card {
  position: relative; margin: 0 12px 20px; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--border);
}
.hero-card img { width: 100%; height: 220px; object-fit: cover; display: block; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 20px;
}
.hero-badge { background: var(--red); color: #fff; font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-full); width: fit-content; margin-bottom: 8px; }
.hero-title { font-size: 1.2rem; font-weight: 800; line-height: 1.2; margin-bottom: 6px; }
.hero-desc  { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-full);
  padding: 10px 20px; font-size: 0.85rem; font-weight: 700; transition: var(--transition); cursor: pointer; }
.btn-red { background: linear-gradient(135deg, var(--red) 0%, #aa0000 100%); color: #fff; box-shadow: 0 4px 15px rgba(255,42,42,0.4); border: 1px solid rgba(255,100,100,0.3); }
.btn-red:hover  { background: var(--red-dark); }
.btn-ghost { background: var(--bg-card); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; border: 1px solid var(--border-glass); }
.btn-ghost:hover { background: rgba(255,255,255,0.15); }

/* =============================================
   CATEGORIES FILTER
   ============================================= */
.categories-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding: 0 12px 16px;
}
.categories-scroll::-webkit-scrollbar { width: 0px; height: 0px; display: none; }
.cat-pill {
  flex-shrink: 0; padding: 6px 16px; border-radius: var(--radius-full);
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.cat-pill.active, .cat-pill:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* =============================================
   GLASS PANELS / CARDS
   ============================================= */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.glass-card-red {
  background: rgba(255,42,42,0.06);
  border-color: var(--border-red);
}

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-input {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  color: var(--text-primary); font-size: 0.9rem; transition: var(--transition);
}
.form-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow2); }
textarea.form-input { resize: vertical; min-height: 100px; }
.form-input::placeholder { color: var(--text-muted); }

/* =============================================
   ALERTS / TOASTS
   ============================================= */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 500; margin-bottom: 16px;
}
.alert-success { background: rgba(0,200,100,0.1); border: 1px solid rgba(0,200,100,0.3); color: #00c864; }
.alert-error   { background: rgba(255,42,42,0.1); border: 1px solid var(--border-red); color: var(--red); }
.alert-info    { background: rgba(0,150,255,0.1); border: 1px solid rgba(0,150,255,0.3); color: #0096ff; }

/* Toast notifications */
#toast-container {
  position: fixed; top: calc(var(--header-height) + 12px); left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  width: calc(100% - 32px); max-width: 380px;
  pointer-events: none;
}
.toast {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 0.85rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  animation: slideDown 0.3s ease; pointer-events: auto;
}
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
@keyframes slideDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:none; } }

/* =============================================
   MODALS
   ============================================= */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 500;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg-glass);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-radius: 24px 24px 20px 20px;
  width: 100%; max-width: 480px; padding: 24px;
  transform: translateY(20px); transition: transform 0.3s ease;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-card);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--text-secondary); transition: var(--transition); border: 1px solid var(--border); }
.modal-close:hover { color: var(--red); border-color: var(--border-red); }

/* =============================================
   VIDEO PLAYER PAGE
   ============================================= */
.player-container {
  position: relative; width: 100%; padding-top: 56.25%; background: #000;
  border-radius: 0; overflow: hidden;
}
.player-container video, .player-container iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: none;
}
.player-locked-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; z-index: 10;
}
.player-locked-overlay .lock-big { font-size: 3rem; margin-bottom: 12px; }
.player-locked-overlay h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.player-locked-overlay p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 20px; }

/* ---- TIKTOK STYLE PLAYER ---- */
.tiktok-player-page {
  padding-bottom: 0 !important;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  background: #000;
}
.tiktok-container {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.tiktok-video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* This makes it look like TikTok by filling the screen */
}
.tiktok-overlay-bottom {
  position: absolute;
  bottom: calc(var(--nav-height) + 20px);
  left: 0;
  right: 80px;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
  z-index: 5;
  pointer-events: none;
}
.tiktok-username { font-weight: 700; font-size: 1rem; margin-bottom: 8px; pointer-events: auto; }
.tiktok-title { font-size: 0.9rem; line-height: 1.4; opacity: 0.9; pointer-events: auto; }

.tiktok-overlay-right {
  position: absolute;
  right: 12px;
  bottom: calc(var(--nav-height) + 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 10;
}
.tiktok-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
  cursor: pointer;
}
.tiktok-action-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.tiktok-action-btn svg { width: 24px; height: 24px; fill: #fff; }
.tiktok-action-btn.active svg { fill: var(--red); }
.tiktok-action-btn:active { transform: scale(0.9); }
.tiktok-action-label { font-size: 0.7rem; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }

/* Progress bar for tiktok style */
.tiktok-progress {
  position: absolute;
  bottom: var(--nav-height);
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,0.2);
  z-index: 20;
}
.tiktok-progress-inner {
  height: 100%;
  background: var(--red);
  width: 0%;
  transition: width 0.1s linear;
}

@media (min-width: 960px) {
  .tiktok-container {
    max-width: 450px;
    height: 800px;
    margin: 40px auto;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    border: 1px solid var(--border);
  }
  .tiktok-player-page { height: auto; overflow: auto; background: var(--bg-primary); }
}

.video-detail { padding: 16px; }
.video-detail-title { font-size: 1.2rem; font-weight: 800; line-height: 1.3; margin-bottom: 8px; }
.video-detail-meta { display: flex; align-items: center; gap: 12px; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px; flex-wrap: wrap; }
.video-detail-actions { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.action-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: var(--radius-full); border: 1px solid var(--border);
  background: var(--bg-card); font-size: 0.78rem; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; transition: var(--transition);
}
.action-btn:hover, .action-btn.active { border-color: var(--red); color: var(--red); }
.video-description { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.65; }

/* =============================================
   STORE / CREDITS
   ============================================= */
.credit-packages { display: flex; flex-direction: column; gap: 12px; padding: 0 12px; }
.package-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  cursor: pointer; transition: var(--transition); position: relative; overflow: hidden;
}
.package-card:hover, .package-card:active { border-color: var(--red); transform: translateY(-2px); box-shadow: var(--shadow-red); }

/* =============================================
   PROFILE PAGE
   ============================================= */
.profile-header {
  display: flex; flex-direction: column; align-items: center; padding: 20px 16px 10px;
}
.avatar {
  width: 80px; height: 80px; border-radius: 50%; background: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; color: #fff; margin-bottom: 12px;
  border: 3px solid var(--border-red);
}
.profile-username { font-size: 1.2rem; font-weight: 800; }
.profile-email    { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

.profile-menu { padding: 0 12px 20px; display: flex; flex-direction: column; gap: 8px; }
.profile-menu-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); text-decoration: none;
  font-size: 0.88rem; font-weight: 500; transition: var(--transition);
}
.profile-menu-item.danger { color: var(--red); }

/* =============================================
   ADMIN PANEL
   ============================================= */
.admin-tab.active { background: var(--red); color: #fff; border-color: var(--red); }

.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border-glass); background: var(--bg-card); backdrop-filter: blur(16px); }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 400px; }
th { padding: 12px 16px; text-align: left; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (min-width: 640px) {
  .video-grid { grid-template-columns: repeat(3, 1fr); }
  .video-scroll .video-card { flex: 0 0 200px; }
}
@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .header { padding: 0 32px; }
  .main-content { padding-top: calc(var(--header-height) + 16px); max-width: 1200px; margin: 0 auto; }
  .video-grid { grid-template-columns: repeat(4, 1fr); padding: 0 24px 8px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 600px) {
  .admin-actions-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
}

/* =============================================
   BTN UTILITIES
   ============================================= */
.btn-sm { padding: 7px 14px; font-size: 0.78rem; }
.btn-block { width: 100%; justify-content: center; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }

/* =============================================
   PAGE LAYOUT HELPERS
   ============================================= */
.page-section { margin-bottom: 24px; }
.page-header { padding: 0 16px 16px; }
.page-title { font-size: 1.4rem; font-weight: 800; }
.page-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.pb-16 { padding-bottom: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-8  { margin-bottom: 8px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-red    { color: var(--red); }
.font-bold   { font-weight: 700; }
.divider     { height: 1px; background: var(--border); margin: 16px 0; }

/* =============================================
   AUTH PAGES
   ============================================= */
.auth-page {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg-primary);
  overflow-y: auto;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-glass); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 24px; padding: 32px 24px;
  box-shadow: var(--shadow);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-icon {
  width: 56px; height: 56px; background: var(--red); border-radius: 16px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
  box-shadow: var(--shadow-red);
}
.auth-logo-icon svg { width: 28px; height: 28px; fill: #fff; }
.auth-title { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: 4px; }
.auth-subtitle { font-size: 0.85rem; color: var(--text-muted); text-align: center; }
.auth-link-row { text-align: center; font-size: 0.82rem; color: var(--text-muted); margin-top: 20px; }
.auth-link-row a { color: var(--red); font-weight: 600; }

/* =============================================
   PROFILE
   ============================================= */
.profile-credits {
  margin-top: 12px; background: var(--red-glow2); border: 1px solid var(--border-red);
  border-radius: var(--radius-full); padding: 6px 20px; font-size: 0.85rem; font-weight: 700; color: var(--red);
}
.profile-menu-item:hover { border-color: var(--border-red); }
.profile-menu-item svg { width: 20px; height: 20px; fill: var(--text-muted); flex-shrink: 0; }
.profile-menu-item .chevron { margin-left: auto; width: 14px; height: 14px; fill: var(--text-muted); }
.profile-menu-item.danger svg { fill: var(--red); }

/* =============================================
   STATS GRID
   ============================================= */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 12px 20px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 6px;
}
.stat-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.stat-icon.red   { background: rgba(255,42,42,0.15); }
.stat-icon.green { background: rgba(0,200,100,0.15); }
.stat-icon.blue  { background: rgba(0,150,255,0.15); }
.stat-icon.gold  { background: rgba(255,180,0,0.15); }
.stat-value { font-size: 1.6rem; font-weight: 900; line-height: 1; }
.stat-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

/* =============================================
   STORE / CREDIT BALANCE
   ============================================= */
.credit-balance-card {
  margin: 0 12px 20px;
  background: linear-gradient(135deg, rgba(255,42,42,0.15) 0%, rgba(255,42,42,0.05) 100%);
  border: 1px solid var(--border-red); border-radius: var(--radius);
  padding: 20px; text-align: center;
}
.credit-balance-number { font-size: 3rem; font-weight: 900; color: var(--red); line-height: 1; }
.credit-balance-label  { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.package-card.popular { border-color: var(--red); }
.popular-tag {
  position: absolute; top: 0; right: 0;
  background: var(--red); color: #fff; font-size: 0.65rem; font-weight: 700;
  padding: 3px 10px; border-radius: 0 var(--radius-sm) 0 var(--radius-sm);
}
.package-icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  background: var(--red-glow2); border: 1px solid var(--border-red);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.5rem;
}
.package-info { flex: 1; }
.package-name   { font-size: 0.9rem; font-weight: 700; }
.package-credits { font-size: 1.6rem; font-weight: 900; color: var(--red); line-height: 1; }
.package-credits span { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }
.package-price { font-size: 1.1rem; font-weight: 800; color: #fff; white-space: nowrap; }

/* =============================================
   ADMIN PANEL FULL STYLES
   ============================================= */
.admin-header { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.admin-nav {
  display: flex; gap: 4px; overflow-x: auto; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.admin-nav::-webkit-scrollbar { display: none; }
.admin-tab {
  flex-shrink: 0; padding: 7px 16px; border-radius: var(--radius-full);
  background: transparent; border: 1px solid transparent;
  font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: var(--transition); text-decoration: none;
}
.admin-tab:hover:not(.active) { border-color: var(--border-red); color: var(--red); }
.admin-content { padding: 16px; }
.admin-section-title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }

thead tr { background: rgba(0,0,0,0.3); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.05); }
.td-thumb { width: 50px; height: 30px; object-fit: cover; border-radius: 6px; }
.td-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 700;
}
.td-badge.success { background: rgba(0,200,100,0.15); color: #00c864; border: 1px solid rgba(0,200,100,0.3); }
.td-badge.danger  { background: rgba(255,42,42,0.15); color: var(--red); border: 1px solid var(--border-red); }
.td-badge.warning { background: rgba(255,180,0,0.15); color: #ffb400; border: 1px solid rgba(255,180,0,0.3); }
.td-badge.info    { background: rgba(0,150,255,0.15); color: #0096ff; border: 1px solid rgba(0,150,255,0.3); }

.btn-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); }
.btn-icon:hover { border-color: var(--border-red); color: var(--red); }
.btn-icon svg { width: 14px; height: 14px; fill: currentColor; }
.btn-icon.danger:hover { border-color: var(--red); background: rgba(255,42,42,0.1); }

.upload-dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: var(--transition); color: var(--text-muted);
}
.upload-dropzone:hover, .upload-dropzone.drag-over { border-color: var(--red); color: var(--red); background: var(--red-glow2); }
.upload-dropzone svg { width: 40px; height: 40px; margin: 0 auto 12px; fill: currentColor; }

/* =============================================
   SELECT FORM INPUT
   ============================================= */
select.form-input { 
  appearance: none; cursor: pointer; 
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); 
  background-repeat: no-repeat; background-position: right 16px center; background-size: 16px; padding-right: 40px; 
}
select.form-input option { background-color: var(--bg-secondary); color: var(--text-primary); }
.form-input.error { border-color: var(--red); }
.form-error { font-size: 0.75rem; color: var(--red); margin-top: 4px; }
.form-hint  { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state svg { width: 60px; height: 60px; fill: var(--text-muted); margin: 0 auto 16px; opacity: 0.4; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }

/* =============================================
   SKELETON LOADING
   ============================================= */
.skeleton { background: linear-gradient(90deg, #1a1a1a 25%, #222 50%, #1a1a1a 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* =============================================
   TOGGLE SWITCH
   ============================================= */
.toggle { position: relative; width: 44px; height: 24px; display: inline-block; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border); border-radius: 12px;
  cursor: pointer; transition: var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--red); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* =============================================
   BADGES
   ============================================= */
.badge-free  { background: rgba(0,200,100,0.15); color: #00c864; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); border: 1px solid rgba(0,200,100,0.3); }
.badge-premium { background: rgba(255,42,42,0.15); color: var(--red); font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); border: 1px solid var(--border-red); }

/* =============================================
   PAGE SECTIONS & HEADERS
   ============================================= */
.page-section { padding: 0 12px; margin-bottom: 20px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding: 0 4px;
}
.section-title {
  font-size: 1.05rem; font-weight: 800; display: flex; align-items: center; gap: 8px;
}
.section-link {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,42,42,0.12);
  border: 1px solid rgba(255,42,42,0.3);
  color: var(--red); font-size: 0.75rem; font-weight: 700;
  padding: 6px 14px; border-radius: var(--radius-full);
  text-decoration: none; transition: var(--transition);
  white-space: nowrap;
}
.section-link:hover {
  background: var(--red); color: #fff;
  box-shadow: var(--shadow-red);
  transform: translateY(-1px);
}

/* =============================================
   VIDEO GRID
   ============================================= */
.video-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; padding: 0 4px;
}
@media (min-width: 768px) { .video-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .video-grid { grid-template-columns: repeat(4, 1fr); } }

/* =============================================
   VIDEO CARD
   ============================================= */
.video-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-card); border: 1px solid var(--border-glass);
  border-radius: var(--radius); overflow: hidden;
  transition: var(--transition);
}
.video-card:hover { transform: translateY(-3px); border-color: var(--border-red); box-shadow: var(--shadow-red); }
.video-thumb {
  position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #111;
}
.video-thumb.is-premium .thumb-img { filter: blur(6px); transform: scale(1.1); }
.thumb-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.video-card:hover .thumb-img { transform: scale(1.05); }

.type-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 0.6rem; font-weight: 700; padding: 2px 7px;
  border-radius: var(--radius-full); text-transform: uppercase;
}
.type-badge.free { background: rgba(0,200,100,0.85); color: #fff; }
.type-badge.premium { background: rgba(255,42,42,0.85); color: #fff; }
.duration-badge {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.7); color: #fff;
  font-size: 0.65rem; font-weight: 600; padding: 2px 6px;
  border-radius: 6px; backdrop-filter: blur(4px);
}
.play-btn {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: var(--transition);
}
.video-card:hover .play-btn { opacity: 1; }
.play-btn-circle {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,42,42,0.9); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(255,42,42,0.5);
}
.play-btn-circle svg { width: 18px; height: 18px; fill: #fff; margin-left: 2px; }

.premium-overlay {
  position: absolute; inset: 0; z-index: 5;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(2px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; padding: 10px;
}
.premium-overlay .lock-icon { font-size: 1.4rem; }
.premium-overlay .premium-label { font-size: 0.75rem; font-weight: 700; color: rgba(255,255,255,0.9); }
.premium-overlay .unlock-btn {
  background: var(--red); color: #fff; border: none;
  font-size: 0.7rem; font-weight: 700; padding: 5px 12px;
  border-radius: var(--radius-full); cursor: pointer;
  transition: var(--transition);
}
.premium-overlay .unlock-btn:hover { background: var(--red-dark); box-shadow: var(--shadow-red); }

.video-info { padding: 10px 12px; }
.video-title { font-size: 0.82rem; font-weight: 700; line-height: 1.3; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { display: flex; align-items: center; justify-content: space-between; }
.video-meta-left { display: flex; gap: 10px; }
.video-stat { display: flex; align-items: center; gap: 3px; font-size: 0.72rem; color: var(--text-muted); }
.video-stat svg { width: 13px; height: 13px; fill: var(--text-muted); }

/* =============================================
   HERO CARD
   ============================================= */
.hero-card {
  display: block; position: relative; border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: #fff;
}
.hero-card img { width: 100%; height: 220px; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 60%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 20px;
}
.hero-badge {
  background: rgba(0,200,100,0.85); color: #fff;
  font-size: 0.65rem; font-weight: 700; padding: 3px 10px;
  border-radius: var(--radius-full); display: inline-block; width: fit-content; margin-bottom: 8px;
}
.hero-title { font-size: 1.3rem; font-weight: 800; line-height: 1.2; margin-bottom: 6px; }
.hero-desc { font-size: 0.8rem; color: rgba(255,255,255,0.7); line-height: 1.3; margin-bottom: 10px; }
.hero-actions { display: flex; gap: 8px; align-items: center; }

/* =============================================
   CATEGORIES PILLS
   ============================================= */
.categories-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding: 0 12px 8px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.categories-scroll::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0; padding: 6px 16px; border-radius: var(--radius-full);
  font-size: 0.82rem; font-weight: 600;
  background: var(--bg-card); border: 1px solid var(--border-glass);
  color: var(--text-secondary); cursor: pointer;
  transition: var(--transition); white-space: nowrap;
}
.cat-pill:hover { border-color: var(--red); color: var(--red); }
.cat-pill.active { background: var(--red); border-color: var(--red); color: #fff; }

/* =============================================
   ADMIN SECTION TITLE (button style links)
   ============================================= */
.admin-section-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 1rem; font-weight: 700; margin-bottom: 12px;
}
.admin-section-title .section-link {
  background: rgba(255,42,42,0.12);
  border: 1px solid rgba(255,42,42,0.3);
  color: var(--red); font-size: 0.75rem; font-weight: 700;
  padding: 6px 14px; border-radius: var(--radius-full);
  text-decoration: none; transition: var(--transition);
}
.admin-section-title .section-link:hover {
  background: var(--red); color: #fff;
  box-shadow: var(--shadow-red);
}

