@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Rich Purple & Royal Gold Palette */
  --bg-color: #0b071a;
  --bg-secondary: #16122b;
  --bg-tertiary: #211a45;

  --primary-accent: #a855f7;
  /* Vibrant Purple */
  --primary-glow: rgba(168, 85, 247, 0.4);

  --secondary-accent: #fbbf24;
  /* Royal Gold / Amber */
  --secondary-glow: rgba(251, 191, 36, 0.3);

  --accent-blue: #3b82f6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  --success: #10b981;
  --danger: #ef4444;

  /* Layout Constants */
  --border-radius: 12px;
  --border-radius-lg: 24px;
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(22, 18, 43, 0.7);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Luxury Utilities */
.text-gradient {
  background: linear-gradient(135deg, #fef3c7, var(--secondary-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.glow-on-hover:hover {
  box-shadow: 0 0 30px var(--primary-glow);
  transform: translateY(-2px);
}

.gold-glow {
  box-shadow: 0 8px 32px var(--secondary-glow);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: var(--glass-border);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* ----------------------------------
   Header & Navigation
----------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 7, 26, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo img {
  display: block;
  height: 42px;
  width: auto;
}

/* Desktop nav */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-accent);
}

.nav-plain {
  color: var(--text-muted);
  font-size: 0.88rem !important;
}

.nav-btn { margin-left: 0.25rem; }

/* Hamburger button — hidden on desktop */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 400;
  position: relative;
}

.nav-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-main);
  border-radius: 2px;
  transition: transform 0.28s ease, opacity 0.28s ease;
  transform-origin: center;
}

.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Overlay */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 350;
}
.nav-overlay.is-open { display: block; }

/* ----------------------------------
   Mobile nav drawer
----------------------------------- */
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  .nav-container { padding: 0.75rem 1.1rem; }

  /* Drawer — slides in from the right, lives outside normal flow */
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(100%);   /* off-screen — no x-overflow */
    width: min(300px, 82vw);
    height: 100dvh;                /* full viewport height */
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4.5rem 0 2rem;
    background: var(--bg-tertiary);
    border-left: 1px solid rgba(168, 85, 247, 0.25);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 400;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
  }

  .nav-links.is-open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .nav-links a {
    display: block;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
    color: var(--text-main);
    margin: 0 !important;
  }

  .nav-links a:last-child { border-bottom: none; }

  .nav-links .btn {
    margin: 0.75rem 1.5rem 0;
    border-radius: var(--border-radius);
    justify-content: center;
    width: calc(100% - 3rem);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, var(--primary-accent));
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.7);
}

.btn-outline {
  background: transparent;
  color: var(--primary-accent);
  border: 2px solid var(--primary-accent);
}

.btn-outline:hover {
  background: rgba(168, 85, 247, 0.1);
  color: white;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: white;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* Layout Core */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  flex: 1;
}

/* Main Main container margin */
main {
  min-height: 80vh;
  padding: 2rem 0;
}

/* Footer */
footer {
  background: #06040d;
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
}

/* ----------------------------------
   Admin & Dashboard App Components
----------------------------------- */

.admin-body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* prevent horizontal bleed only */
}

.admin-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  background: var(--bg-color);
}

.admin-sidebar {
  width: 260px;
  background: var(--bg-tertiary);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(168,85,247,0.3) transparent;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.3); border-radius: 2px; }

.admin-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2.5rem;
  background: var(--bg-color);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.admin-content {
  flex: 1;
  padding: 2.5rem;
  background: var(--bg-secondary);
  overflow-y: auto;
}

/* SPA page transition */
.admin-content.spa-loading { opacity: 0.4; pointer-events: none; transition: opacity .15s; }
.admin-content.spa-loaded  { animation: spaFadeIn .2s ease forwards; }
@keyframes spaFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.admin-nav {
  list-style: none;
  padding: 1rem 0;
  margin: 0;
  flex: 1;
}

.admin-nav li {
  margin: 0;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.3s ease;
}

.admin-nav a i {
  width: 20px;
  text-align: center;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
  background: var(--bg-secondary);
  border-left-color: var(--primary-accent);
}

.admin-nav a:hover i,
.admin-nav a.active i {
  color: var(--primary-accent);
}

/* Old dashboard grid logic logic (useful for producer/library) */
.dashboard-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  margin-top: -2rem;
  align-items: start;
}

.dashboard-hero,
.library-hero,
.producer-hero {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-color));
  padding: 4rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.sidebar {
  padding: 2rem;
  position: sticky;
  top: 100px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--bg-tertiary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  text-align: center;
}

.stat-card h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-accent);
}

.admin-card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.admin-card h2 {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ----------------------------------
   Admin Sub-Components (Cards, Tables, Grids)
----------------------------------- */
.upload-card {
  background: var(--bg-tertiary);
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 3rem;
  text-align: center;
  margin-bottom: 2rem;
  transition: border-color 0.3s;
  cursor: pointer;
}

.upload-card:hover {
  border-color: var(--primary-accent);
}

.upload-card i {
  font-size: 3rem;
  color: var(--primary-accent);
  margin-bottom: 1rem;
}

.movie-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.movie-table th,
.movie-table td {
  padding: 1.2rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.batch-creator {
  background: var(--bg-tertiary);
  padding: 2rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.submission-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: 100px 1fr 200px;
  gap: 1.5rem;
  align-items: center;
}

.producer-tag {
  font-size: 0.85rem;
  color: var(--primary-accent);
  background: rgba(168, 85, 247, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.user-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.user-info {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.user-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-accent);
  border: 1px solid var(--primary-accent);
}

.badge-role {
  font-size: 0.75rem;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.role-producer {
  background: rgba(168, 85, 247, 0.1);
  color: var(--primary-accent);
}

.role-operator {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.vj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.vj-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
}

.vj-card .vj-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.1);
  color: var(--primary-accent);
  border: 2px solid var(--primary-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1rem;
}

.cat-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem;
}

.plan-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 1rem;
}

/* ----------------------------------
   Dashboard Sub-Components (Producer/Library)
----------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  color: var(--text-muted);
  font-weight: 500;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.85rem;
}

.badge-pending {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
}

.badge-approved {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.badge-rejected {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.batch-box {
  margin-bottom: 2rem;
  padding: 2rem;
  background: linear-gradient(to right, rgba(168, 85, 247, 0.05), transparent);
  border-left: 4px solid var(--primary-accent);
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-secondary);
  padding: 3rem;
  border-radius: var(--border-radius-lg);
  max-width: 500px;
  width: 100%;
  border: 1px solid var(--primary-accent);
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.2);
}

.receipt-header {
  text-align: center;
  margin-bottom: 2rem;
  border-bottom: 1px dashed var(--text-muted);
  padding-bottom: 1rem;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

/* ----------------------------------
   Responsive Design (non-nav)
----------------------------------- */
@media (max-width: 768px) {
  /* --- General layout --- */
  .container { padding: 0 1rem; }
  main { padding: 1rem 0; }
  .form-grid { grid-template-columns: 1fr; }

  /* --- Hero --- */
  .hero { height: auto; min-height: 60vh; padding: 3rem 0; }
  .hero-title { font-size: 2.2rem; }

  /* --- Movie cards --- */
  .movie-card { min-width: 160px; max-width: 160px; }
  .movie-card img { height: 240px; }

  /* --- Pricing grid --- */
  .glass-panel[style*="scale(1.05)"] { transform: none !important; }

  /* --- Tables --- */
  .movie-table,
  .table,
  .lib-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .movie-table th,
  .movie-table td,
  .table th,
  .table td {
    padding: 0.75rem;
    font-size: 0.88rem;
  }

  /* --- Admin layout --- */
  .admin-layout { flex-direction: column; height: auto; min-height: 100vh; }
  .admin-wrapper { overflow: visible; height: auto; }
  .admin-content { overflow: visible; flex: none; }

  .admin-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  .admin-nav {
    display: flex;
    flex-wrap: wrap;
    padding: 0.5rem;
  }

  .admin-nav a {
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    border-left: none;
    border-bottom: 2px solid transparent;
  }

  .admin-nav a:hover,
  .admin-nav a.active {
    border-left-color: transparent;
    border-bottom-color: var(--primary-accent);
  }

  .admin-content { padding: 1.25rem; }
  .admin-topbar  { padding: 1rem 1.25rem; }

  /* --- Stat cards --- */
  .stat-grid,
  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  /* --- Batch / package box --- */
  .batch-box { padding: 1.25rem; }
  .batch-box > div { flex-direction: column !important; }

  /* --- Modal --- */
  .modal-content {
    padding: 1.75rem 1.25rem;
    margin: 1rem;
    width: calc(100% - 2rem);
  }

  /* --- VJ grid --- */
  .vj-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }

  /* --- Submission card --- */
  .submission-card { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.75rem; }
  .stat-grid,
  .stats-row { grid-template-columns: 1fr; }
  .section-title { font-size: 1.25rem; }
  .movie-card { min-width: 140px; max-width: 140px; }
  .movie-card img { height: 200px; }
}

/* ----------------------------------
   Bottom Tab Navigation
----------------------------------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 68px;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: #0d0b18;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 500;
}

.bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1;
  text-decoration: none;
  color: #5a5470;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.4rem 0.25rem;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s;
  position: relative;
}

/* Icon wrapper — gives the active pill shape */
.bottom-tab .bn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 28px;
  border-radius: 14px;
  transition: background 0.2s;
}

.bottom-tab i {
  font-size: 1.15rem;
  line-height: 1;
  transition: color 0.2s;
  color: #5a5470;
}

.bottom-tab span {
  font-size: 0.68rem;
  line-height: 1;
}

/* ── Active state ── */
.bottom-tab.is-active {
  color: var(--primary-accent);
}

.bottom-tab.is-active .bn-icon {
  background: rgba(168, 85, 247, 0.18);
}

.bottom-tab.is-active i {
  color: var(--primary-accent);
}

/* Push page content above the nav */
body {
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}

/* Hide on portal / admin pages */
.lib-portal-body .bottom-nav,
.admin-body .bottom-nav {
  display: none;
}

/* Desktop — hide bottom nav */
@media (min-width: 769px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
}

/* ----------------------------------
   Auth page background
----------------------------------- */
.auth-bg {
  min-height: 100vh;
  background:
    linear-gradient(rgba(0,0,0,0.72), rgba(0,0,0,0.72)),
    url('../logo/bg.jpg') center/cover no-repeat fixed;
}

/* ensure the glass card stays readable on top */
.auth-bg .glass-panel {
  background: rgba(11, 7, 26, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* ----------------------------------
   Search Bar — movies & series pages
----------------------------------- */
.search-bar {
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
    width: 160px;
    padding: 0.45rem 0.85rem 0.45rem 2rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.15);
    background: var(--bg-secondary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 0.65rem center;
    color: var(--text-main);
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, width 0.25s ease, box-shadow 0.2s;
}
.search-bar:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 2px rgba(168,85,247,0.25);
    width: 200px;
}
.search-bar::placeholder { color: var(--text-muted); }
/* hide the native clear button on WebKit */
.search-bar::-webkit-search-cancel-button,
.search-bar::-webkit-search-decoration { -webkit-appearance: none; }

@media (min-width: 769px) {
    .search-bar { width: 220px; }
    .search-bar:focus { width: 280px; }
}

/* ----------------------------------
   Admin Responsive Layout
----------------------------------- */

/* Hamburger button — hidden on desktop */
.admin-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: background 0.2s;
    flex-shrink: 0;
}
.admin-hamburger:hover { background: rgba(255,255,255,0.06); }

/* Sidebar overlay (mobile) */
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 299;
}
.admin-sidebar-overlay.is-open { display: block; }

/* Admin name label — show on desktop */
@media (min-width: 769px) {
    .admin-name-label { display: inline !important; }
}

@media (max-width: 768px) {
    /* Stack layout vertically — release height lock so page scrolls naturally */
    .admin-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    /* Wrapper must NOT clip content on mobile */
    .admin-wrapper {
        overflow: visible;
        height: auto;
    }

    /* Content area scrolls with the page, not inside a fixed box */
    .admin-content {
        overflow: visible;
        padding: 1rem;
        flex: none;
    }

    /* Sidebar slides in from left */
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100dvh;
        z-index: 300;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
        border-right: 1px solid rgba(168,85,247,0.25);
    }
    .admin-sidebar.is-open { transform: translateX(0); }

    /* Show hamburger */
    .admin-hamburger { display: flex; align-items: center; justify-content: center; }

    /* Topbar adjustments */
    .admin-topbar {
        padding: 0.85rem 1rem;
        gap: 0.75rem;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    /* Tables scroll horizontally */
    .movie-table,
    .lib-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Form grids collapse to single column */
    .form-grid { grid-template-columns: 1fr !important; }

    /* Stats row — 2 columns on mobile */
    .stats-row,
    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    /* Modal full-width on mobile */
    .modal-content {
        width: calc(100% - 2rem) !important;
        max-width: none !important;
        margin: 1rem;
        padding: 1.25rem !important;
    }

    /* Submission cards stack */
    .submission-card { grid-template-columns: 1fr; }

    /* Admin topbar title font size */
    .admin-topbar h2 { font-size: 1rem; }

    /* Batch box */
    .batch-box > div { flex-direction: column !important; }
}

@media (max-width: 480px) {
    .stats-row,
    .stat-grid { grid-template-columns: 1fr; }
    .admin-content { padding: 0.75rem; }
}

/* ----------------------------------
   Toast Notifications
----------------------------------- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    min-width: 240px;
    max-width: 360px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    pointer-events: auto;
    animation: toast-in 0.3s cubic-bezier(0.4,0,0.2,1) forwards;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.toast.toast-out {
    animation: toast-out 0.3s cubic-bezier(0.4,0,0.2,1) forwards;
}
.toast-success { background: rgba(16,185,129,0.92); border-left: 4px solid #10b981; }
.toast-error   { background: rgba(239,68,68,0.92);  border-left: 4px solid #ef4444; }
.toast-info    { background: rgba(59,130,246,0.92);  border-left: 4px solid #3b82f6; }
.toast-warning { background: rgba(245,158,11,0.92);  border-left: 4px solid #f59e0b; }
.toast i       { font-size: 1rem; flex-shrink: 0; }
.toast-msg     { flex: 1; line-height: 1.4; }
.toast-close   { background: none; border: none; color: rgba(255,255,255,0.7); cursor: pointer; font-size: 1rem; padding: 0; flex-shrink: 0; }
.toast-close:hover { color: #fff; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

@media (max-width: 480px) {
    #toast-container { bottom: 80px; right: 12px; left: 12px; }
    .toast { min-width: unset; max-width: 100%; }
}
