/* Nuvio Admin · tema cinema 2026 */
:root {
  --bg: #05080f;
  --bg2: #0c1220;
  --surface: rgba(16, 24, 40, 0.92);
  --surface2: #141e32;
  --border: rgba(99, 132, 199, 0.18);
  --primary: #5b7cfa;
  --primary2: #22d3ee;
  --primary-h: #7c9bff;
  --success: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --text: #eef2ff;
  --dim: #8b9cc7;
  --radius: 14px;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  --glass: blur(16px) saturate(1.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(91, 124, 250, 0.22), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(34, 211, 238, 0.12), transparent),
    linear-gradient(180deg, #05080f 0%, #0a1020 100%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--primary2); text-decoration: none; }

/* ── Auth screens ── */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-screen.hidden { display: none !important; }

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow);
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-logo {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-tagline {
  color: var(--dim);
  font-size: 0.88rem;
  margin-top: 0.35rem;
}

.auth-card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.auth-card .sub {
  color: var(--dim);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.input-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.input-wrap label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.input-wrap input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 124, 250, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, var(--primary), #4f6fe8);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.full { width: 100%; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface2); transform: none; }
.btn.sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }

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

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

.err-msg {
  margin: 0.75rem 0;
  padding: 0.7rem 0.9rem;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.85rem;
  display: none;
}

.err-msg.show { display: block; }

.hint-box {
  margin-top: 1rem;
  padding: 0.65rem 0.85rem;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--dim);
}

.overlay { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.overlay.hidden, .wizard-overlay.hidden { display: none !important; }
.card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 2rem; box-shadow: var(--shadow); }
.card h2 { font-size: 1.3rem; margin-bottom: 0.3rem; background: linear-gradient(135deg, var(--primary), var(--primary2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.card .sub { color: var(--dim); font-size: 0.85rem; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.75rem; color: var(--dim); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.7rem 1rem; color: var(--text); font-size: 0.9rem; font-family: inherit;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); }

.wizard-overlay { position: fixed; inset: 0; z-index: 9500; overflow-y: auto; padding: 2rem 1rem; display: flex; align-items: flex-start; justify-content: center; }
.wizard-box { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 2rem; width: 100%; max-width: 640px; margin: auto; box-shadow: var(--shadow); }
.wizard-box h2 { font-size: 1.4rem; margin-bottom: 0.3rem; background: linear-gradient(135deg, var(--primary), var(--primary2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.steps { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.step-dot { flex: 1; height: 4px; background: var(--border); border-radius: 2px; }
.step-dot.active { background: var(--primary); }
.step-dot.done { background: var(--success); }
.step-panel { display: none; }
.step-panel.active { display: block; }
.step-panel h3 { margin-bottom: 0.3rem; }
.step-panel .help { color: var(--dim); font-size: 0.85rem; margin-bottom: 1rem; }
.input-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.input-row input { flex: 1; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 1rem; color: var(--text); }
.browse-box, .folder-list { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; max-height: 240px; overflow-y: auto; margin-bottom: 1rem; }
.browse-item, .folder-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.8rem; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.browse-item:hover, .folder-item:hover { background: var(--surface2); }
.mount-pill { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.8rem; background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.3); border-radius: 8px; margin-bottom: 1rem; font-size: 0.83rem; color: var(--success); }
.step-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.5rem; }

/* ── App shell ── */
#app { display: none; height: 100%; flex-direction: column; position: relative; z-index: 1; }
#app.visible { display: flex; }

.topbar {
  background: rgba(12, 18, 32, 0.95);
  backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.topbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar-right { display: flex; align-items: center; gap: 0.6rem; }

.addon-url-btn {
  font-size: 0.75rem;
  color: var(--dim);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-body { display: flex; flex: 1; min-height: 0; overflow: hidden; }

.sidebar {
  background: rgba(12, 18, 32, 0.6);
  border-right: 1px solid var(--border);
  width: 220px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1.1rem;
  margin: 0.15rem 0.5rem;
  cursor: pointer;
  color: var(--dim);
  font-size: 0.88rem;
  border-radius: 10px;
  transition: all 0.15s;
  user-select: none;
}

.nav-item:hover { color: var(--text); background: var(--surface2); }
.nav-item.active { color: #fff; background: linear-gradient(135deg, rgba(91,124,250,0.35), rgba(34,211,238,0.12)); border-left: none; }

.main-area { flex: 1; overflow-y: auto; padding: 1.5rem; }

.page { display: none; animation: fadeIn 0.25s ease; }
.page.active { display: block; }

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

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}

.stat-card .label { font-size: 0.72rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.35rem; }
.stat-card .value { font-size: 1.75rem; font-weight: 700; }
.stat-card .value.p { color: var(--primary2); }
.stat-card .value.s { color: var(--success); }
.stat-card .value.w { color: var(--warn); }

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
th { color: var(--dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:hover td { background: var(--surface2); }

.badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 6px; font-size: 0.72rem; font-weight: 600; }
.badge.movie { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.badge.series { background: rgba(91, 124, 250, 0.15); color: var(--primary2); }
.badge.active { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.badge.revoked { background: rgba(248, 113, 113, 0.15); color: var(--danger); }

.log-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  max-height: 420px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.65;
}

.log-line.error { color: var(--danger); }
.log-line.warn { color: var(--warn); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot.on { background: var(--success); box-shadow: 0 0 8px var(--success); }
.dot.off { background: var(--danger); }

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.3rem;
  font-size: 0.88rem;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 9999;
  box-shadow: var(--shadow);
}

.toast.show { transform: translateY(0); opacity: 1; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 8000; padding: 1rem; }
.modal-bg.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }

.mobile-nav { display: none; background: var(--surface); border-top: 1px solid var(--border); padding: 0.4rem; flex-shrink: 0; overflow-x: auto; }
.mobile-nav-item { display: flex; flex-direction: column; align-items: center; padding: 0.5rem 0.7rem; cursor: pointer; color: var(--dim); font-size: 0.65rem; border-radius: 8px; flex-shrink: 0; }
.mobile-nav-item.active { color: var(--primary2); background: rgba(91,124,250,0.12); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.95); }
}

@media (max-width: 700px) {
  .sidebar { display: none; }
  .mobile-nav { display: flex; }
  .main-area { padding: 1rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
