/* ==========================================================================
   Netflix NFToken Studio — Minimal Modern Redesign
   ========================================================================== */

:root {
  --bg-primary: #09090b;
  --bg-secondary: #111113;
  --bg-card: rgba(17, 17, 19, 0.85);
  --bg-card-hover: rgba(24, 24, 28, 0.9);
  --bg-input: #0c0c0e;
  
  --netflix-red: #e50914;
  --netflix-red-hover: #ff1a27;
  --netflix-red-glow: rgba(229, 9, 20, 0.25);
  --netflix-red-soft: rgba(229, 9, 20, 0.08);
  
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.12);
  --gold: #eab308;
  --gold-soft: rgba(234, 179, 8, 0.1);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.1);
  --red-warn: #ef4444;

  --text-main: #fafafa;
  --text-secondary: #a1a1aa;
  --text-dim: #52525b;
  
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(229, 9, 20, 0.5);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --font-ar: 'Cairo', system-ui, sans-serif;
  --font-en: 'Inter', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', ui-monospace, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

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

html[dir="ltr"] body { font-family: var(--font-en); }

.hidden { display: none !important; }

/* Subtle ambient gradient */
body::before {
  content: '';
  position: fixed;
  top: -40%;
  right: -20%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(229, 9, 20, 0.06) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* Remove old glow divs */
.bg-glow, .ambient-stars { display: none; }

/* ===== HEADER ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  background: rgba(9, 9, 11, 0.8);
  border-bottom: 1px solid var(--border);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(229, 9, 20, 0.35);
  background: transparent;
}

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

.token-badge { display: none; }

.brand-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.brand-subtitle { display: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Pool badge */
.pool-live-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--green-soft);
  border: 1px solid rgba(34, 197, 94, 0.2);
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--green);
  font-weight: 600;
}

.pool-pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.pool-badge-num {
  font-weight: 800;
  color: var(--text-main);
  font-size: 0.8rem;
}

/* Device Quota Badge (3 Activations Daily) */
.device-quota-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--blue-soft);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  color: #60a5fa;
  font-weight: 600;
  transition: all 0.2s var(--ease);
}

.device-quota-badge.quota-warning {
  background: var(--gold-soft);
  border-color: rgba(234, 179, 8, 0.3);
  color: var(--gold);
}

.device-quota-badge.quota-exhausted {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.quota-sparkle {
  font-size: 0.85rem;
}

.quota-badge-num {
  font-weight: 800;
  color: var(--text-main);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.quota-pill-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  margin-top: 0.5rem;
}

.quota-pill-hint strong {
  color: #60a5fa;
}

.quota-pill-hint.exhausted strong {
  color: var(--red-warn);
}

/* Admin & Lang Buttons */
.btn-admin-nav, .lang-switch-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-admin-nav:hover, .lang-switch-btn:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
  background: rgba(255,255,255,0.03);
}

.lang-icon { display: none; }

/* ===== MAIN ===== */
.main-wrapper {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

/* ===== HERO ===== */
.hero-section {
  text-align: center;
  margin-bottom: 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--netflix-red-soft);
  border: 1px solid rgba(229, 9, 20, 0.2);
  color: var(--netflix-red);
  padding: 0.25rem 0.8rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: 0.2px;
}

.badge-icon { display: none; }

.hero-title {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: #fff;
  letter-spacing: -0.5px;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 1.5rem;
  line-height: 1.55;
}

/* ===== TABS ===== */
.nav-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: var(--radius-md);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-icon { display: none; }

.tab-btn:hover { color: var(--text-main); }

.tab-btn.active {
  background: var(--netflix-red);
  color: #fff;
}

.history-count-badge {
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ===== TAB CONTENT ===== */
.tab-content { display: none; animation: fadeIn 0.2s ease; }
.tab-content.active { display: block; }

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

/* ===== CARDS ===== */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.15s ease;
}

.glass-card:hover { border-color: var(--border-hover); }

/* ===== GRID ===== */
.grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

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

/* ===== CARD HEADER ===== */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title-group { display: flex; align-items: center; gap: 0.5rem; }
.card-icon { display: none; }
.card-title { font-size: 1rem; font-weight: 700; }

.format-badge, .format-badge.highlight {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* ===== POOL SPOTLIGHT ===== */
.pool-spotlight-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, var(--netflix-red-soft), transparent);
  border: 1px solid rgba(229, 9, 20, 0.15);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.pool-spotlight-icon { display: none; }

.pool-spotlight-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.pool-highlight-badge {
  background: var(--netflix-red);
  color: #fff;
  padding: 0.15rem 0.6rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 800;
}

.pool-spotlight-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ===== BUTTONS ===== */
.pool-generate-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.btn-primary-action {
  position: relative;
  width: 100%;
  background: var(--netflix-red);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.btn-primary-action:hover {
  background: var(--netflix-red-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--netflix-red-glow);
}

.btn-primary-action:active { transform: translateY(0); }

.btn-massive { font-size: 1.05rem; padding: 1rem 1.5rem; }

.btn-glow { display: none; }

.btn-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-icon { display: none; }

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner.show { display: inline-block; }

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

.pool-helper-text {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
}

/* ===== TOOLBAR ===== */
.input-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tool:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: var(--border-hover);
}

.btn-danger-soft:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red-warn);
  border-color: rgba(239, 68, 68, 0.25);
}

/* ===== TEXTAREA ===== */
.cookie-textarea, .admin-textarea {
  width: 100%;
  min-height: 180px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.15s ease;
}

.cookie-textarea:focus, .admin-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* ===== ACCORDION ===== */
.custom-cookie-accordion {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

.accordion-header-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.accordion-header-btn:hover { color: var(--text-main); border-color: var(--border-hover); }

.acc-icon { display: none; }
.acc-chevron { font-size: 0.7rem; transition: transform 0.2s ease; }
.acc-chevron.rotated { transform: rotate(180deg); }

.accordion-body { margin-top: 0.75rem; animation: fadeIn 0.2s ease; }
.accordion-body.hidden { display: none; }

.btn-secondary-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.7rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary-action:hover { background: rgba(255,255,255,0.08); }

/* ===== RESULT ===== */
.result-container {
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.placeholder-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.25rem;
  margin: auto;
}

.placeholder-icon-wrap { display: none; }
.placeholder-icon { display: none; }

.placeholder-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.4rem; }

.placeholder-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  max-width: 320px;
  margin-bottom: 1.2rem;
}

.feature-bullets { display: flex; flex-direction: column; gap: 0.3rem; text-align: start; }
.f-bullet { font-size: 0.8rem; color: var(--text-dim); }

/* Active Result */
.active-result-box {
  animation: fadeIn 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.active-result-box.hidden { display: none; }

.result-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.badge-success {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--green-soft);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--green);
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-dot {
  width: 5px;
  height: 5px;
  background: var(--green);
  border-radius: 50%;
}

.source-account-badge {
  font-size: 0.72rem;
  background: var(--blue-soft);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--blue);
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
}

.expiry-badge {
  font-size: 0.75rem;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(234, 179, 8, 0.2);
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
}

.result-item { display: flex; flex-direction: column; gap: 0.3rem; }

.result-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
}

.copy-input-group { display: flex; gap: 0.4rem; }

.result-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  color: #fff;
  font-size: 0.82rem;
  font-family: inherit;
  text-overflow: ellipsis;
}

.result-input.font-mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #93c5fd;
}

.btn-copy, .btn-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.15s ease;
}

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

.btn-copy:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--border-hover); }

.btn-open-link {
  background: var(--netflix-red);
  border: none;
  color: #fff;
}

.btn-open-link:hover { background: var(--netflix-red-hover); }
.copy-icon { display: none; }

/* QR & Quick Actions */
.qr-and-quick-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  margin-top: 0.3rem;
}

@media (max-width: 600px) { .qr-and-quick-actions { grid-template-columns: 1fr; } }

.qr-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.qr-title { font-size: 0.75rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--text-dim); }

.qr-img-wrapper {
  width: 120px;
  height: 120px;
  background: #0d0d11;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.qr-img-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.qr-sub { font-size: 0.68rem; color: var(--text-dim); margin-top: 0.4rem; }

.quick-tv-jump-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tv-jump-icon { display: none; }
.tv-jump-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.3rem; }
.tv-jump-desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.45; margin-bottom: 0.8rem; }

.btn-tv-jump {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: transparent;
  border: 1px solid var(--netflix-red);
  color: var(--netflix-red);
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tv-jump:hover { background: var(--netflix-red); color: #fff; }

/* ===== TV TAB ===== */
.tv-wrapper { max-width: 1000px; margin: 0 auto; }

.tv-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.tv-icon-big { display: none; }
.tv-main-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 0.3rem; }
.tv-main-desc { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; }

.tv-activation-content {
  margin-top: 0.5rem;
}

.tv-method-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 720px;
  margin: 0 auto;
  gap: 1.25rem;
  align-items: stretch;
}

.tv-method-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.primary-tv-method {
  border-color: rgba(229, 9, 20, 0.28);
  background: linear-gradient(180deg, rgba(229, 9, 20, 0.04) 0%, rgba(20, 20, 28, 0.6) 100%);
}

.secondary-tv-method {
  border-color: rgba(59, 130, 246, 0.25);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.03) 0%, rgba(20, 20, 28, 0.6) 100%);
}

.method-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--netflix-red);
  background: var(--netflix-red-soft);
  border: 1px solid rgba(229, 9, 20, 0.25);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.65rem;
  max-width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.method-tag-secondary {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
}

.method-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: #fff;
}

.method-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.1rem;
}

/* TV Token Active Box */
.tv-token-ready-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: fadeIn 0.25s ease;
}

.token-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  max-width: fit-content;
}

.token-active-badge .status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.token-preview-text {
  font-size: 0.76rem;
  font-weight: 700;
  color: #34d399;
}

/* TV Open Primary & Secondary Buttons */
.tv-open-btn,
.tv-open-official {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.tv-open-btn {
  background: var(--netflix-red);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.35);
}

.tv-open-btn:hover {
  background: var(--netflix-red-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.45);
}

.tv-open-official {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.tv-open-official:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #fff;
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

.tv-open-btn .btn-content,
.tv-open-official .btn-content {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* No token callout */
.tv-no-token-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.no-token-callout {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* TV QR Subcard */
.tv-qr-subcard {
  margin-top: 0.75rem;
  padding: 0.9rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tv-qr-sub-header {
  margin-bottom: 0.4rem;
}

.qr-mini-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.tv-qr-container {
  width: 120px;
  height: 120px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.4rem 0;
  padding: 4px;
}

.tv-qr-container img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Instructions & 2 steps */
.tv-simple-steps {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.steps-mini-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.2rem;
}

.simple-step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.simple-step-item .step-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.simple-step-item strong {
  display: block;
  font-size: 0.82rem;
  color: #f1f5f9;
  margin-bottom: 0.15rem;
}

.simple-step-item p {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

/* ===== HISTORY TAB ===== */
.history-wrapper { max-width: 1000px; margin: 0 auto; }
.history-table-container { overflow-x: auto; }

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: start;
}

.history-table th {
  padding: 0.7rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.history-table td {
  padding: 0.85rem;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.history-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.history-actions { display: flex; gap: 0.35rem; }
.btn-mini { padding: 0.3rem 0.55rem; font-size: 0.72rem; }

.empty-history-state { text-align: center; padding: 2.5rem 1rem; }
.empty-icon { display: none; }

/* ===== GUIDE TAB ===== */
.guide-wrapper { max-width: 1000px; margin: 0 auto; }

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 800px) { .guide-grid { grid-template-columns: 1fr; } }

.guide-icon-header { display: none; }
.guide-article-title { font-size: 1.05rem; font-weight: 800; margin-bottom: 0.85rem; }

.guide-numbered-list {
  padding-inline-start: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guide-numbered-list li strong { display: block; font-size: 0.88rem; margin-bottom: 0.15rem; }
.guide-numbered-list li p { font-size: 0.8rem; color: var(--text-secondary); }

.guide-numbered-list code {
  background: var(--netflix-red-soft);
  color: var(--netflix-red);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

html[dir="rtl"] .toast-container { left: auto; right: 1.5rem; }

.toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(17, 17, 19, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  animation: toastIn 0.25s ease;
  min-width: 240px;
}

.toast.toast-success { border-color: rgba(34, 197, 94, 0.3); }
.toast.toast-error { border-color: rgba(239, 68, 68, 0.3); }

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

/* ===== FOOTER ===== */
.app-footer {
  border-top: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.7);
  padding: 1.25rem 1.5rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

@media (max-width: 600px) {
  .footer-container { flex-direction: column; gap: 0.4rem; text-align: center; }
}

/* ==========================================================================
   ADMIN MODAL — Minimal
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.hidden { display: none; }

.admin-modal-card {
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  padding: 1.5rem;
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.admin-modal-brand { display: flex; align-items: center; gap: 0.65rem; }
.admin-lock-icon { display: none; }
.admin-modal-title { font-size: 1.1rem; font-weight: 800; }
.admin-modal-subtitle { font-size: 0.75rem; color: var(--text-dim); }

.btn-close-modal {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-close-modal:hover { background: rgba(239, 68, 68, 0.1); color: var(--red-warn); }

/* Admin Login */
.admin-login-box {
  max-width: 380px;
  margin: 2rem auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.admin-login-label { font-size: 0.9rem; font-weight: 700; }

.admin-input-row { display: flex; gap: 0.4rem; }

.admin-pass-input, .admin-text-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  color: #fff;
  font-size: 0.88rem;
  font-family: inherit;
}

.admin-pass-input:focus, .admin-text-input:focus { outline: none; border-color: var(--border-focus); }

.btn-sm-action { width: auto; padding: 0.65rem 1.2rem; font-size: 0.85rem; }

.admin-hint { font-size: 0.72rem; color: var(--text-dim); }
.admin-hint code { color: var(--netflix-red); background: var(--netflix-red-soft); padding: 1px 4px; border-radius: 3px; }

/* Admin Subtabs */
.admin-subtabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

.admin-subtab-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-subtab-btn:hover { color: var(--text-main); }

.admin-subtab-btn.active {
  background: var(--netflix-red-soft);
  color: var(--netflix-red);
}

.badge-tag {
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.68rem;
  padding: 0px 5px;
  border-radius: 8px;
}

/* Admin Content */
.admin-atab-content { display: none; animation: fadeIn 0.2s ease; }
.admin-atab-content.active { display: block; }

.admin-add-form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: flex; flex-direction: column; gap: 0.35rem; }
.form-row label { font-size: 0.82rem; font-weight: 700; color: var(--text-secondary); }

.label-with-tool { display: flex; align-items: center; justify-content: space-between; }

.admin-textarea-hint { font-size: 0.7rem; color: var(--text-dim); }
.admin-textarea-hint code { color: var(--netflix-red); background: var(--netflix-red-soft); padding: 1px 3px; border-radius: 2px; }

.btn-admin-action { max-width: 240px; }
.form-actions { margin-top: 0.3rem; }

/* Inventory */
.inventory-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.inv-stats { font-size: 0.82rem; color: var(--text-secondary); }
.inv-stats strong { color: #fff; }
.inv-stats .text-green { color: var(--green); }
.inv-stats .sep { margin: 0 0.4rem; color: var(--text-dim); }
.inv-actions { display: flex; gap: 0.4rem; }

.admin-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; text-align: start; }

.admin-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 0.6rem 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.admin-table td { padding: 0.6rem 0.85rem; border-bottom: 1px solid rgba(255, 255, 255, 0.03); }
.admin-table tr:hover td { background: rgba(255, 255, 255, 0.015); }

.status-badge-active { color: var(--green); background: var(--green-soft); padding: 2px 7px; border-radius: 100px; font-weight: 700; font-size: 0.7rem; }
.status-badge-inactive { color: var(--red-warn); background: rgba(239, 68, 68, 0.1); padding: 2px 7px; border-radius: 100px; font-weight: 700; font-size: 0.7rem; }
.status-badge-expired { color: var(--gold); background: var(--gold-soft); padding: 2px 7px; border-radius: 100px; font-weight: 700; font-size: 0.7rem; }

.admin-table-ops { display: flex; gap: 0.3rem; }

.btn-op {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-op:hover { background: rgba(255,255,255,0.06); color: #fff; border-color: var(--border-hover); }
.btn-op.btn-op-danger:hover { background: rgba(239, 68, 68, 0.1); color: var(--red-warn); border-color: rgba(239, 68, 68, 0.25); }

/* Settings */
.admin-settings-box { display: flex; flex-direction: column; gap: 1.25rem; max-width: 420px; }
.settings-title { font-size: 0.95rem; font-weight: 700; }
.admin-divider { border: none; border-top: 1px solid var(--border); margin: 0.3rem 0; }

.history-controls { display: flex; gap: 0.4rem; }
.pool-badge-label { font-weight: 600; }

/* ==========================================================================
   RESPONSIVE DESIGN — Mobile & Tablet
   ========================================================================== */

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

  .tv-activation-grid {
    grid-template-columns: 1fr;
  }

  .tv-reveal-cards-grid {
    grid-template-columns: 1fr;
  }

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

  .qr-and-quick-actions {
    grid-template-columns: 1fr;
  }
}

/* ===== MOBILE & SMALL TABLET (max-width: 768px) ===== */
@media (max-width: 768px) {
  .hero-title,
  .hero-desc {
    display: none !important;
  }

  .hero-section {
    margin-bottom: 0.75rem;
  }

  /* Hide secondary TV activation card on mobile */
  .secondary-tv-method {
    display: none !important;
  }
}

/* ===== MOBILE (max-width: 640px) ===== */
@media (max-width: 640px) {
  html {
    font-size: 14px;
  }

  /* Header */
  .header-container {
    height: auto;
    padding: 0.65rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .brand {
    gap: 0.5rem;
  }

  .logo-box {
    width: 28px;
    height: 28px;
    border-radius: 6px;
  }

  .brand-title {
    font-size: 0.88rem;
  }

  .header-actions {
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  .pool-live-badge {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
  }

  .pool-badge-num {
    font-size: 0.72rem;
  }

  .device-quota-badge {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
  }

  .btn-admin-nav,
  .lang-switch-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
  }

  /* Main wrapper */
  .main-wrapper {
    padding: 1.25rem 0.85rem 3rem;
  }

  /* Hero */
  .hero-section {
    margin-bottom: 0.75rem;
  }

  .hero-title,
  .hero-desc {
    display: none !important;
  }

  /* Tabs — horizontal scroll on mobile */
  .nav-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 1px;
    width: 100%;
    padding: 2px;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 0 0 auto;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }

  .history-count-badge {
    font-size: 0.62rem;
    padding: 0px 5px;
  }

  /* Cards */
  .glass-card {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  /* Pool Spotlight */
  .pool-spotlight-card {
    padding: 0.85rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .pool-spotlight-title {
    font-size: 0.82rem;
  }

  .pool-spotlight-sub {
    font-size: 0.72rem;
  }

  /* Generate Button */
  .btn-massive {
    font-size: 0.92rem;
    padding: 0.85rem 1rem;
  }

  .pool-helper-text {
    font-size: 0.65rem;
  }

  /* Accordion */
  .accordion-header-btn {
    padding: 0.55rem 0.75rem;
    font-size: 0.75rem;
  }

  /* Results */
  .result-container {
    min-height: auto;
  }

  .placeholder-state {
    padding: 1.5rem 0.85rem;
  }

  .placeholder-title {
    font-size: 0.95rem;
  }

  .placeholder-desc {
    font-size: 0.75rem;
  }

  .copy-input-group {
    flex-wrap: wrap;
  }

  .result-input {
    min-width: 0;
    width: 100%;
    font-size: 0.75rem;
    padding: 0.5rem 0.6rem;
  }

  .btn-copy,
  .btn-open-link {
    padding: 0.45rem 0.6rem;
    font-size: 0.72rem;
  }

  .result-label {
    font-size: 0.72rem;
  }

  /* QR Section */
  .qr-and-quick-actions {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .qr-box {
    padding: 0.75rem;
  }

  .qr-img-wrapper {
    width: 100px;
    height: 100px;
  }

  /* TV Section */
  .tv-wrapper {
    max-width: 100%;
  }

  .tv-card-header {
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
  }

  .tv-main-title {
    font-size: 1rem;
  }

  .tv-main-desc {
    font-size: 0.78rem;
  }

  .tv-code-input {
    font-size: 1.1rem;
    letter-spacing: 2px;
    padding: 0.6rem 0.75rem;
  }

  .tv-code-input-wrap {
    flex-direction: column;
  }

  .btn-paste-code {
    padding: 0.5rem;
    text-align: center;
  }

  .tv-guide-side {
    padding: 0.85rem;
  }

  .guide-side-title {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
  }

  .guide-step-card {
    gap: 0.5rem;
  }

  .step-circle {
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
  }

  .step-details strong {
    font-size: 0.78rem;
  }

  .step-details p {
    font-size: 0.7rem;
  }

  /* TV Reveal Cards */
  .tv-reveal-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .tv-method-card {
    padding: 0.85rem;
  }

  .method-title {
    font-size: 0.82rem;
  }

  .method-desc {
    font-size: 0.72rem;
    margin-bottom: 0.5rem;
  }

  .tv-qr-container {
    width: 90px;
    height: 90px;
  }

  /* History */
  .history-wrapper {
    max-width: 100%;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .history-table th,
  .history-table td {
    padding: 0.5rem;
    font-size: 0.7rem;
  }

  .btn-mini {
    padding: 0.2rem 0.4rem;
    font-size: 0.65rem;
  }

  /* Guide */
  .guide-wrapper {
    max-width: 100%;
  }

  .guide-article-title {
    font-size: 0.92rem;
  }

  .guide-numbered-list li strong {
    font-size: 0.78rem;
  }

  .guide-numbered-list li p {
    font-size: 0.72rem;
  }

  /* Toast */
  .toast-container {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }

  html[dir="rtl"] .toast-container {
    left: 0.75rem;
    right: 0.75rem;
  }

  .toast {
    min-width: 0;
    width: 100%;
    font-size: 0.75rem;
    padding: 0.55rem 0.85rem;
  }

  /* Footer */
  .app-footer {
    padding: 0.85rem 1rem;
  }

  .footer-container {
    flex-direction: column;
    gap: 0.3rem;
    text-align: center;
    font-size: 0.68rem;
  }

  /* Quick TV Jump */
  .quick-tv-jump-card {
    padding: 0.85rem;
  }

  .tv-jump-title {
    font-size: 0.85rem;
  }

  .tv-jump-desc {
    font-size: 0.72rem;
    margin-bottom: 0.5rem;
  }

  .btn-tv-jump {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
  }

  /* Textarea */
  .cookie-textarea {
    min-height: 140px;
    font-size: 0.72rem;
    padding: 0.65rem;
  }

  /* Input toolbar */
  .input-toolbar {
    gap: 0.3rem;
  }

  .btn-tool {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }

  .btn-secondary-action {
    padding: 0.55rem;
    font-size: 0.78rem;
  }

  /* Feature bullets */
  .f-bullet {
    font-size: 0.72rem;
  }

  /* Incognito hint text */
  .active-result-box small {
    font-size: 0.7rem !important;
  }
}

/* ===== VERY SMALL SCREENS (max-width: 380px) ===== */
@media (max-width: 380px) {
  html {
    font-size: 13px;
  }

  .header-container {
    padding: 0.5rem 0.65rem;
  }

  .main-wrapper {
    padding: 1rem 0.6rem 2.5rem;
  }

  .nav-tabs {
    border-radius: var(--radius-sm);
  }

  .tab-btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.68rem;
  }

  .glass-card {
    padding: 0.75rem;
  }

  .pool-spotlight-card {
    padding: 0.65rem 0.75rem;
  }

  .btn-massive {
    font-size: 0.82rem;
    padding: 0.75rem 0.85rem;
  }

  .copy-input-group {
    flex-direction: column;
  }

  .btn-copy,
  .btn-open-link {
    width: 100%;
    justify-content: center;
  }
}
