/* ── Admin Panel Styles ── */
:root {
  --adm-bg: #0e0e1a;
  --adm-panel: #161626;
  --adm-card: #1e1e32;
  --adm-border: rgba(255,255,255,0.1);
  --adm-accent: #6C3BFF;
  --adm-gold: #FFD700;
}

body { background: var(--adm-bg); }

/* ── Login ── */
.login-wrap {
  position: relative; z-index: 1;
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  padding: 80px 20px;
}

.login-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: 24px; padding: 48px 40px;
  text-align: center; max-width: 380px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-icon { font-size: 3.5rem; margin-bottom: 16px; }
.login-card h1 { font-family: 'Bungee', cursive; font-size: 1.8rem; color: var(--gold); }
.login-sub { color: var(--text-dim); font-size: 0.9rem; margin: 8px 0 24px; }
.form-group { margin-bottom: 12px; }
.admin-input {
  width: 100%; padding: 12px 18px; border-radius: 10px;
  background: rgba(255,255,255,0.07); border: 1px solid var(--adm-border);
  color: #fff; font-size: 1rem; font-family: 'Nunito', sans-serif;
  outline: none; transition: border-color 0.3s;
}
.admin-input:focus { border-color: var(--adm-accent); }
.login-error { color: #ff6b6b; font-size: 0.85rem; margin-bottom: 12px; }
.login-hint  { color: var(--text-dim); font-size: 0.8rem; margin-top: 16px; }
.login-hint code { color: var(--gold); background: rgba(255,215,0,0.1); padding: 2px 6px; border-radius: 4px; }

/* ── Admin Layout ── */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-sidebar.open { display: flex; position: fixed; inset: 0; z-index: 200; }
}

/* ── Sidebar ── */
.admin-sidebar {
  background: var(--adm-panel);
  border-right: 1px solid var(--adm-border);
  display: flex; flex-direction: column;
  padding: 20px 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-logo {
  padding: 16px 20px 24px;
  border-bottom: 1px solid var(--adm-border);
  margin-bottom: 12px;
}
.sidebar-logo span { font-family: 'Bungee', cursive; font-size: 1.1rem; color: var(--adm-gold); }
.sidebar-logo small { display: block; color: var(--text-dim); font-size: 0.75rem; margin-top: 2px; }

.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; color: var(--text-dim);
  text-decoration: none; font-size: 0.9rem; font-weight: 600;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  color: #fff; background: rgba(108,59,255,0.15);
  border-left-color: var(--adm-accent);
}
.sidebar-nav a .nav-icon { font-size: 1.1rem; }

.sidebar-bottom {
  margin-top: auto; padding: 16px 20px;
  border-top: 1px solid var(--adm-border);
  display: flex; flex-direction: column; gap: 8px;
}
.sidebar-bottom a {
  color: var(--text-dim); text-decoration: none;
  font-size: 0.85rem; transition: color 0.2s;
}
.sidebar-bottom a:hover { color: var(--adm-gold); }

/* ── Main content ── */
.admin-main {
  padding: 32px 28px;
  overflow-y: auto;
}
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; padding-bottom: 16px;
  border-bottom: 1px solid var(--adm-border);
}
.admin-topbar h2 { font-family: 'Bungee', cursive; font-size: 1.4rem; color: #fff; }
.save-indicator {
  font-size: 0.8rem; color: var(--green);
  opacity: 0; transition: opacity 0.3s;
}
.save-indicator.show { opacity: 1; }

/* ── Tab panels ── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Section cards ── */
.admin-section {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: 16px; padding: 24px;
  margin-bottom: 20px;
}
.section-title {
  font-family: 'Bungee', cursive; font-size: 0.95rem;
  color: var(--adm-gold); letter-spacing: 1px;
  margin-bottom: 20px; padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,215,0,0.15);
}

/* ── Form elements ── */
.field-row {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 16px;
}
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 0.8rem; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.admin-input,
.admin-select {
  padding: 10px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--adm-border);
  color: #fff; font-size: 0.9rem; font-family: 'Nunito', sans-serif;
  outline: none; transition: border-color 0.3s;
  width: 100%;
}
.admin-input:focus, .admin-select:focus { border-color: var(--adm-accent); }
.admin-select option { background: var(--adm-card); }

/* Range slider */
.range-wrap { display: flex; align-items: center; gap: 12px; }
input[type="range"] {
  flex: 1; -webkit-appearance: none; height: 6px;
  background: rgba(255,255,255,0.15); border-radius: 3px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--adm-accent); cursor: pointer;
  box-shadow: 0 0 8px rgba(108,59,255,0.6);
}
.range-val { min-width: 30px; text-align: right; color: var(--adm-accent); font-weight: 800; }

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; gap: 12px; }
.toggle {
  position: relative; width: 46px; height: 24px; flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0; border-radius: 24px;
  background: rgba(255,255,255,0.15); cursor: pointer;
  transition: background 0.3s;
}
.toggle input:checked ~ .toggle-track { background: var(--adm-accent); }
.toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform 0.3s;
}
.toggle input:checked ~ .toggle-track::after { transform: translateX(22px); }

/* Color picker */
.color-grid {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.color-swatch-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.color-swatch-wrap label { font-size: 0.7rem; color: var(--text-dim); }
input[type="color"] {
  width: 44px; height: 44px; border-radius: 8px; border: 2px solid var(--adm-border);
  cursor: pointer; background: none; padding: 2px;
}

/* ── Prize table ── */
.prize-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th {
  text-align: left; padding: 8px 12px; color: var(--text-dim);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--adm-border);
}
td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.prize-color-dot {
  width: 18px; height: 18px; border-radius: 50%; display: inline-block;
}
.prize-row:hover td { background: rgba(255,255,255,0.03); }

.tbl-input {
  background: transparent; border: none; border-bottom: 1px solid transparent;
  color: #fff; font-family: 'Nunito', sans-serif; font-size: 0.875rem;
  outline: none; width: 100%; transition: border-color 0.2s;
}
.tbl-input:focus { border-bottom-color: var(--adm-accent); }

.btn-icon {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; padding: 4px 6px; border-radius: 6px;
  transition: background 0.2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.1); }
.btn-delete { color: #ff6b6b; }
.btn-add-prize {
  margin-top: 12px; padding: 9px 20px;
  background: rgba(108,59,255,0.2); border: 1px solid rgba(108,59,255,0.4);
  color: var(--adm-accent); border-radius: 8px; cursor: pointer;
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 0.875rem;
  transition: all 0.2s;
}
.btn-add-prize:hover { background: rgba(108,59,255,0.35); }

/* ── Save button ── */
.btn-save {
  padding: 12px 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--adm-accent), #a78bfa);
  color: #fff; font-family: 'Bungee', cursive; font-size: 0.9rem; letter-spacing: 1px;
  border: none; cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(108,59,255,0.4);
}
.btn-save:hover { transform: scale(1.03); box-shadow: 0 6px 28px rgba(108,59,255,0.6); }

/* ── Preview panel ── */
.preview-mini {
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--adm-border);
  background: var(--bg-dark);
  padding: 16px; text-align: center;
}
.preview-mini canvas { border-radius: 8px; }

/* ── Mobile topbar ── */
.mobile-menu-btn {
  display: none; background: none; border: none; color: #fff;
  font-size: 1.4rem; cursor: pointer; padding: 6px;
}
@media (max-width: 768px) {
  .mobile-menu-btn { display: block; }
  .admin-main { padding: 20px 16px; }
  .field-row { grid-template-columns: 1fr; }
}
