/* The Devil's Jukebox — Admin Panel Styles */

/* ─── Admin shell ────────────────────────────────────────────────────────── */
body.admin-page {
  background: #080808;
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #0a0a0a;
  border-right: 1px solid #1e1e1e;
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid #1e1e1e;
  margin-bottom: 1rem;
}
.sidebar-logo-text {
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
}
.sidebar-logo-text .accent { color: var(--accent, #00d4c8); }
.sidebar-logo-sub {
  font-size: 0.72rem;
  color: #555;
  font-weight: 500;
  margin-top: 0.2rem;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #444;
  padding: 0.75rem 1.5rem 0.25rem;
}
.sidebar-nav { list-style: none; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #666;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 1.5rem;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  cursor: pointer;
}
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,0.04); text-decoration: none; }
.sidebar-nav a.active { color: var(--accent, #00d4c8); background: rgba(0,212,200,0.06); border-left-color: var(--accent, #00d4c8); }
.sidebar-nav .nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.5rem;
  border-top: 1px solid #1e1e1e;
}
.sidebar-footer a { font-size: 0.8rem; color: #555; text-decoration: none; }
.sidebar-footer a:hover { color: var(--accent, #00d4c8); }

/* ─── Main content ───────────────────────────────────────────────────────── */
.admin-main {
  margin-left: 240px;
  flex: 1;
  padding: 2rem;
  max-width: calc(100% - 240px);
  overflow-x: hidden;
}

/* ─── Page sections ──────────────────────────────────────────────────────── */
.admin-section { display: none; }
.admin-section.active { display: block; }

/* ─── Page header ────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-title { font-size: 1.5rem; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.page-subtitle { font-size: 0.875rem; color: #555; margin-top: 0.2rem; }

/* ─── Stats grid ─────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  padding: 1.25rem;
}
.stat-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: #555; margin-bottom: 0.4rem; }
.stat-value { font-size: 2rem; font-weight: 900; color: #fff; line-height: 1; }
.stat-sub { font-size: 0.75rem; color: #555; margin-top: 0.3rem; }

/* ─── Panel / Card ───────────────────────────────────────────────────────── */
.panel {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #1e1e1e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.panel-title { font-size: 0.9rem; font-weight: 700; color: #fff; }
.panel-body { padding: 1.25rem; }

/* ─── Table ──────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  text-align: left; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: #555;
  padding: 0.625rem 1rem; border-bottom: 1px solid #1e1e1e; background: #0d0d0d;
}
.data-table td { padding: 0.875rem 1rem; border-bottom: 1px solid #151515; vertical-align: middle; color: #ccc; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.025); }
.data-table .col-actions { white-space: nowrap; text-align: right; }

/* ─── Status badges ──────────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.2rem 0.5rem; border-radius: 4px;
}
.status-published { background: rgba(0,200,122,0.12); color: #00c87a; }
.status-draft { background: rgba(255,170,0,0.12); color: #ffaa00; }

/* ─── Type badge ─────────────────────────────────────────────────────────── */
.type-badge {
  display: inline-block;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.18rem 0.45rem; border-radius: 4px;
}
.type-post    { background: rgba(255,170,0,0.1); color: #ffaa00; }
.type-audio   { background: rgba(0,212,200,0.1); color: #00d4c8; }
.type-video   { background: rgba(255,80,80,0.1); color: #ff6060; }
.type-youtube { background: rgba(255,80,80,0.1); color: #ff6060; }
.type-gallery { background: rgba(130,80,255,0.1); color: #a070ff; }
.type-mixed   { background: rgba(0,180,255,0.1);  color: #00b4ff; }

/* ─── Form in admin ──────────────────────────────────────────────────────── */
.admin-form .form-section { margin-bottom: 2rem; }
.admin-form .form-section-title {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent, #00d4c8); margin-bottom: 1rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid #1e1e1e;
}
.admin-form .form-label { color: #ccc; }

.upload-zone {
  border: 2px dashed #2a2a2a;
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #555;
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent, #00d4c8); color: var(--accent, #00d4c8); background: rgba(0,212,200,0.04); }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-zone-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.upload-zone-label { font-size: 0.875rem; font-weight: 600; }
.upload-zone-sub { font-size: 0.75rem; margin-top: 0.25rem; }

.preview-img { max-width: 180px; max-height: 180px; border-radius: 8px; object-fit: cover; margin-top: 0.75rem; border: 1px solid #222; }
.preview-audio { margin-top: 0.75rem; width: 100%; }
.preview-video { margin-top: 0.75rem; max-width: 320px; border-radius: 8px; }

/* ─── Rich text editor ───────────────────────────────────────────────────── */
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 2px;
  background: #0d0d0d; border: 1px solid #1e1e1e;
  border-bottom: none; border-radius: 8px 8px 0 0;
  padding: 0.5rem;
}
.editor-toolbar button {
  background: none; border: none; cursor: pointer;
  color: #888; font-size: 0.875rem; font-weight: 600;
  padding: 0.35rem 0.6rem; border-radius: 5px;
  transition: all 0.12s; line-height: 1;
}
.editor-toolbar button:hover { color: #fff; background: rgba(255,255,255,0.08); }
.editor-toolbar button.active { color: var(--accent, #00d4c8); background: rgba(0,212,200,0.08); }
.editor-toolbar .toolbar-sep { width: 1px; background: #222; margin: 0.2rem 0.3rem; align-self: stretch; }
.editor-content {
  min-height: 220px; background: #0a0a0a;
  border: 1px solid #1e1e1e; border-radius: 0 0 8px 8px;
  padding: 1rem; color: #eee; font-size: 0.9rem; line-height: 1.7;
  outline: none;
}
.editor-content:focus { border-color: var(--accent, #00d4c8); box-shadow: 0 0 0 3px rgba(0,212,200,0.08); }
.editor-content h1,.editor-content h2,.editor-content h3 { font-weight: 800; margin: 1.25rem 0 0.5rem; letter-spacing: -0.02em; }
.editor-content h1 { font-size: 1.75rem; }
.editor-content h2 { font-size: 1.4rem; }
.editor-content h3 { font-size: 1.1rem; }
.editor-content p { margin-bottom: 0.75rem; }
.editor-content blockquote { border-left: 3px solid #00d4c8; padding: 0.5rem 1rem; background: rgba(0,212,200,0.07); margin: 1rem 0; color: #888; }
.editor-content a { color: #00d4c8; }
.editor-content ul, .editor-content ol { padding-left: 1.5rem; margin-bottom: 0.75rem; }

/* ─── Waveform preview in admin ──────────────────────────────────────────── */
.waveform-preview { display: flex; align-items: flex-end; gap: 1px; height: 40px; margin-top: 0.75rem; background: #0a0a0a; border: 1px solid #1e1e1e; border-radius: 6px; padding: 0.3rem 0.5rem; overflow: hidden; }
.waveform-preview-bar { flex: 1; background: var(--accent, #00d4c8); opacity: 0.5; border-radius: 1px; min-height: 2px; }

/* ─── Color pickers ──────────────────────────────────────────────────────── */
.color-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.color-field { display: flex; flex-direction: column; gap: 0.35rem; }
.color-field label { font-size: 0.75rem; font-weight: 600; color: #888; }
.color-swatch-wrap { display: flex; align-items: center; gap: 0.5rem; background: #0a0a0a; border: 1px solid #222; border-radius: 8px; padding: 0.4rem 0.75rem; }
.color-swatch { width: 24px; height: 24px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.1); flex-shrink: 0; }
.color-swatch-wrap input[type=color] { opacity: 0; position: absolute; width: 0; height: 0; }
.color-hex { font-size: 0.8rem; font-family: monospace; color: #ccc; width: 70px; background: none; border: none; outline: none; }

/* ─── Media grid ─────────────────────────────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.media-item {
  background: #0d0d0d; border: 1px solid #1e1e1e; border-radius: 8px;
  overflow: hidden; position: relative; cursor: pointer; transition: all 0.15s;
}
.media-item:hover { border-color: #333; }
.media-item.selected { border-color: var(--accent, #00d4c8); box-shadow: 0 0 0 2px rgba(0,212,200,0.25); }
.media-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #111; }
.media-thumb-placeholder { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 2rem; background: #111; color: #333; }
.media-info { padding: 0.5rem; }
.media-name { font-size: 0.72rem; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-size { font-size: 0.68rem; color: #555; }
.media-delete { position: absolute; top: 0.35rem; right: 0.35rem; background: rgba(255,64,64,0.85); border: none; border-radius: 4px; color: #fff; font-size: 0.75rem; padding: 0.2rem 0.35rem; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.media-item:hover .media-delete { opacity: 1; }

/* ─── Toggle switch ──────────────────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 0.75rem; }
.toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #2a2a2a; border-radius: 22px; transition: 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; bottom: 3px;
  background: #666; border-radius: 50%; transition: 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--accent, #00d4c8); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: #000; }
.toggle-label { font-size: 0.875rem; color: #ccc; }

/* ─── Alert / Info box ───────────────────────────────────────────────────── */
.alert { padding: 0.875rem 1rem; border-radius: 8px; font-size: 0.875rem; margin-bottom: 1rem; }
.alert-info    { background: rgba(0,212,200,0.08); border: 1px solid rgba(0,212,200,0.2); color: #00d4c8; }
.alert-warning { background: rgba(255,170,0,0.08); border: 1px solid rgba(255,170,0,0.2); color: #ffaa00; }
.alert-success { background: rgba(0,200,122,0.08); border: 1px solid rgba(0,200,122,0.2); color: #00c87a; }
.alert-danger  { background: rgba(255,64,64,0.08);  border: 1px solid rgba(255,64,64,0.2);  color: #ff4040; }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 200; align-items: center; justify-content: center; padding: 1.5rem; }
.modal-overlay.open { display: flex; }
.modal { background: #111; border: 1px solid #222; border-radius: 14px; max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid #1e1e1e; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: #666; font-size: 1.25rem; cursor: pointer; padding: 0.25rem; }
.modal-close:hover { color: #fff; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid #1e1e1e; display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ─── Tags input ─────────────────────────────────────────────────────────── */
.tags-input { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.5rem; background: #0a0a0a; border: 1px solid #222; border-radius: 8px; min-height: 42px; cursor: text; }
.tags-input:focus-within { border-color: var(--accent, #00d4c8); }
.tag-chip { background: rgba(0,212,200,0.12); color: #00d4c8; border: none; border-radius: 4px; padding: 0.2rem 0.5rem; font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; gap: 0.3rem; cursor: default; }
.tag-chip-remove { background: none; border: none; color: inherit; cursor: pointer; font-size: 0.9rem; padding: 0; line-height: 1; opacity: 0.7; }
.tag-chip-remove:hover { opacity: 1; }
.tags-input input { flex: 1; min-width: 80px; background: none; border: none; color: #fff; font-size: 0.875rem; outline: none; padding: 0.1rem 0.25rem; }

/* ─── Login page ─────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-box { background: #111; border: 1px solid #1e1e1e; border-radius: 16px; padding: 2.5rem; width: 100%; max-width: 380px; }
.login-logo { font-size: 1.75rem; font-weight: 900; text-align: center; margin-bottom: 0.5rem; }
.login-logo .accent { color: var(--accent, #00d4c8); }
.login-sub { text-align: center; color: #555; font-size: 0.85rem; margin-bottom: 2rem; }
.login-error { color: #ff4040; font-size: 0.85rem; text-align: center; margin-top: 0.75rem; display: none; }
.login-error.show { display: block; }

/* ─── Mobile admin ───────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  .admin-sidebar.open { transform: none; }
  .admin-main { margin-left: 0; max-width: 100%; }
  .sidebar-toggle { display: flex; }
}
.sidebar-toggle {
  display: none; position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 100;
  background: var(--accent, #00d4c8); color: #000; border: none; border-radius: 50%;
  width: 48px; height: 48px; font-size: 1.25rem; cursor: pointer; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(0,212,200,0.4);
}
