:root {
  --bg-primary: #070a11;
  --bg-secondary: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --accent: #e50914;
  --accent-hover: #ff1e27;
  --success: #10b981;
  --success-hover: #059669;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --border-light: rgba(255, 255, 255, 0.08);
  --badge-bg: rgba(229, 9, 20, 0.15);
  --radius: 12px;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  flex-wrap: wrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-icon {
  font-size: 1.8rem;
}

.brand-badge {
  font-size: 0.75rem;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.search-box {
  display: flex;
  flex: 1;
  max-width: 600px;
  gap: 10px;
}

.search-box input {
  flex: 1;
  min-width: 0;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.25);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  user-select: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #b91c1c);
  color: #fff;
  box-shadow: 0 4px 14px rgba(229, 9, 20, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(229, 9, 20, 0.45);
}

.btn-launch-mpv {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-launch-mpv:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-launch-vlc {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.btn-launch-vlc:hover {
  background: linear-gradient(135deg, #fb923c, #f97316);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.45);
}

.btn-launch-mx {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-launch-mx:hover {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #475569;
  border-color: #64748b;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
}

/* Filters Bar */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}

.filter-btn {
  padding: 8px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn.active {
  background: var(--accent);
  color: #fff;
}

.quick-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tag:hover {
  border-color: var(--accent);
  color: #fff;
  background: var(--bg-card);
}

/* Results & Catalog Grid */
.results-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.results-info h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(229, 9, 20, 0.6);
  box-shadow: var(--shadow);
}

.card-poster-wrap {
  position: relative;
  width: 100%;
  padding-top: 145%;
  background: #020617;
  overflow: hidden;
}

.card-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card-poster {
  transform: scale(1.06);
}

.card-type-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-type-tag.series {
  color: #c084fc;
  border-left: 3px solid #a855f7;
}

.card-type-tag.movie {
  color: #60a5fa;
  border-left: 3px solid #3b82f6;
}

.card-lang-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.card-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Spinner */
.loading-spinner {
  text-align: center;
  padding: 60px 0;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

/* Modal Core */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 10;
  box-shadow: var(--shadow);
  animation: modalEnter 0.25s ease-out;
}

.modal-card.stream-card {
  max-width: 900px;
}

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: var(--transition);
}

.modal-close:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.modal-body {
  padding: 24px;
}

/* Details Layout */
.details-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.details-poster {
  width: 200px;
  max-height: 300px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  background: #020617;
}

.details-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.details-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.25;
  color: #fff;
}

.details-meta-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.meta-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.details-desc {
  color: #cbd5e1;
  font-size: 0.92rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.season-selector-wrap {
  margin-bottom: 18px;
  background: var(--bg-card);
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.season-selector-wrap label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #cbd5e1;
}

.season-controls {
  display: flex;
  gap: 12px;
}

.select-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  outline: none;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.select-input:focus {
  border-color: var(--accent);
}

.select-input option {
  background: var(--bg-secondary);
  color: #fff;
  padding: 8px;
}

/* Stream Launcher Modal */
.stream-header {
  margin-bottom: 18px;
}

.stream-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.player-meta-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stream-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stream-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.stream-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.cmd-box {
  background: #020617;
  border: 1px solid #1e293b;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  color: #38bdf8;
  overflow-x: auto;
  margin-top: 10px;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
}

.btn-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #10b981;
  color: #fff;
  padding: 12px 22px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: var(--transition);
  z-index: 2000;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 📱 Complete Mobile Responsive Media Queries */
@media (max-width: 768px) {
  .app-container {
    padding: 14px;
  }

  .navbar {
    padding: 14px;
    gap: 12px;
  }

  .nav-brand {
    font-size: 1.25rem;
  }

  .search-box {
    max-width: 100%;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .quick-tags {
    overflow-x: auto;
    flex-wrap: nowrap;
    width: 100%;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .quick-tags::-webkit-scrollbar {
    display: none;
  }

  .modal {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-card {
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
  }

  .modal-body {
    padding: 18px 14px;
  }

  .details-layout {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .details-poster {
    width: 150px;
    max-height: 225px;
  }

  .details-info {
    width: 100%;
  }

  .details-title {
    font-size: 1.35rem;
    text-align: center;
  }

  .details-meta-tags {
    justify-content: center;
  }

  .season-controls {
    flex-direction: column;
    gap: 8px;
  }

  .btn {
    width: 100%;
    padding: 12px 16px;
  }

  .btn-actions {
    flex-direction: column;
  }

  .stream-item-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .card-info {
    padding: 8px;
  }

  .card-title {
    font-size: 0.85rem;
  }
}


/* ==========================================================================
   Admin PIN Lock Overlay & Security Styles
   ========================================================================== */
.admin-lock-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #0f172a 0%, #030712 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}

.admin-lock-card {
  background: rgba(30, 41, 59, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 215, 0, 0.35);
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.1);
  animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-lock-icon {
  font-size: 44px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.4));
}

.admin-lock-card h2 {
  font-size: 1.6rem;
  color: #f8fafc;
  margin-bottom: 8px;
  font-weight: 700;
}

.admin-lock-card p {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.admin-pin-group {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-pin-group input {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px 18px;
  color: #f8fafc;
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
  letter-spacing: 2px;
}

.admin-pin-group input:focus {
  border-color: #ffd700;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

.admin-pin-error {
  color: #ef4444;
  font-size: 0.88rem;
  min-height: 20px;
  font-weight: 500;
  margin-bottom: 14px;
}

.admin-lock-footer {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 20px;
  letter-spacing: 0.5px;
}

.btn-lock-portal {
  padding: 8px 14px;
  font-size: 0.85rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  border-radius: 8px;
}

.btn-lock-portal:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.shake {
  animation: shakeAnimation 0.4s ease-in-out;
}

@keyframes shakeAnimation {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
