/* ============================================================
   nam0ij Admin Panel — Stylesheet
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #070709;
  --bg-2: #0d0d12;
  --bg-3: rgba(255,255,255,0.03);
  --border: rgba(255,255,255,0.08);
  --border-bright: rgba(255,255,255,0.14);
  --accent: #7c3aed;
  --accent-light: #a855f7;
  --cyan: #06b6d4;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --text: #f4f4f8;
  --text-2: #94a3b8;
  --text-3: #4a5568;
  --font: 'Space Grotesk', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --r: 12px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }

/* ── Login Screen ── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#login-screen::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 60% 40%, rgba(124,58,237,0.2) 0%, transparent 60%),
              radial-gradient(circle at 20% 80%, rgba(6,182,212,0.12) 0%, transparent 50%);
  pointer-events: none;
}

.login-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  padding: 52px 48px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(20px);
}

.login-icon { font-size: 40px; margin-bottom: 20px; }
.login-title { font-size: 26px; font-weight: 800; letter-spacing: -0.8px; margin-bottom: 6px; }
.login-sub { font-size: 13px; color: var(--text-2); margin-bottom: 32px; }

.login-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.login-input:focus { border-color: var(--accent-light); }
.login-input::placeholder { letter-spacing: 0; font-family: var(--font); color: var(--text-3); }

.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  border: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.login-btn:hover { transform: scale(1.02); box-shadow: 0 0 30px rgba(124,58,237,0.4); }

.login-error {
  margin-top: 12px;
  font-size: 13px;
  color: #f87171;
  min-height: 20px;
}

/* ── Admin Panel ── */
#admin-panel { display: none; min-height: 100vh; }

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-logo {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.sidebar-logo-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.sidebar-logo-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 3px;
  font-family: var(--mono);
}

.sidebar-nav { flex: 1; padding: 0 12px; }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-nav-item:hover {
  background: var(--bg-3);
  color: var(--text);
}

.sidebar-nav-item.active {
  background: rgba(124,58,237,0.15);
  color: var(--accent-light);
  border: 1px solid rgba(124,58,237,0.2);
}

.sidebar-nav-icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-view-site {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.2s;
}

.sidebar-view-site:hover { color: var(--text); }

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
  font-family: var(--font);
}

.sidebar-logout:hover { color: #f87171; }

/* ── Main Content ── */
.admin-main {
  margin-left: 260px;
  min-height: 100vh;
  padding: 40px;
}

.page-section { display: none; }
.page-section.active { display: block; }

.admin-page-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.admin-page-desc {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 36px;
}

/* ── Dashboard ── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.dash-stat-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
}

.dash-stat-num {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 4px;
}

.dash-stat-label { font-size: 12px; color: var(--text-2); font-weight: 600; }

.dash-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border: none;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-light); box-shadow: 0 0 20px rgba(124,58,237,0.4); }

.btn-success { background: rgba(16,185,129,0.15); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.btn-success:hover { background: rgba(16,185,129,0.25); }

.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-ghost { background: var(--bg-3); color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-bright); color: var(--text); }

/* ── Form ── */
.form-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
}

.form-card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-label .required { color: #f87171; margin-left: 3px; }

.form-input, .form-select, .form-textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }
.form-select option { background: var(--bg-2); }

.form-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: var(--font);
  line-height: 1.6;
}

.form-textarea.mono-area { font-family: var(--mono); font-size: 13px; min-height: 140px; }

.form-hint { font-size: 11px; color: var(--text-3); margin-top: 3px; }

.form-actions { display: flex; gap: 12px; margin-top: 24px; }

/* ── Items List ── */
.items-list { display: flex; flex-direction: column; gap: 12px; }

.item-row {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s;
}

.item-row:hover { border-color: rgba(124,58,237,0.3); }

.item-thumb {
  width: 60px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-2);
  flex-shrink: 0;
}

.item-video-thumb {
  object-fit: cover;
  background: #050508;
}

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

.item-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta { font-size: 12px; color: var(--text-2); }

.item-type-badge {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.item-actions { display: flex; gap: 8px; flex-shrink: 0; }

.item-edit-btn, .item-del-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-2);
}

.item-edit-btn:hover { border-color: var(--accent-light); color: var(--accent-light); }
.item-del-btn:hover { border-color: #f87171; color: #f87171; }

/* ── Toast Notifications ── */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.3s var(--ease);
  max-width: 340px;
  backdrop-filter: blur(20px);
}

.toast-success { border-color: rgba(16,185,129,0.4); color: #34d399; }
.toast-error { border-color: rgba(239,68,68,0.4); color: #f87171; }
.toast-info { border-color: rgba(124,58,237,0.4); color: var(--accent-light); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ── Import/Export ── */
.export-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-top: 24px;
}

.export-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.export-desc { font-size: 14px; color: var(--text-2); margin-bottom: 20px; }

.export-btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Tag Input ── */
.tag-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 46px;
  transition: border-color 0.2s;
}

.tag-input-wrapper:focus-within { border-color: var(--accent-light); }

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(124,58,237,0.2);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-light);
}

.tag-remove {
  background: none;
  border: none;
  color: var(--accent-light);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.tag-remove:hover { opacity: 1; }

.tag-input-field {
  border: none;
  outline: none;
  background: none;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  min-width: 100px;
  flex: 1;
}

.tag-input-field::placeholder { color: var(--text-3); }

/* ── Mobile ── */
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s var(--ease); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; padding: 24px 16px; }
}
