/* admin.css — Admin dashboard styling — VUN Fotoportal
   Developed by Vincent van Unen | www.unen.nl | code@unen.nl */

:root {
  --prussian:    #013449;
  --mint:        #2DD4BF;
  --mint-dark:   #20a899;
  --mint-light:  #7ee8d9;
  --gray:        #E5E7EB;
  --bg:          #010e1a;
  --bg-surface:  #011f33;
  --bg-card:     #022a45;
  --bg-hover:    #03364f;
  --text:        #e2e8f0;
  --text-muted:  #8B9BB4;
  --text-dim:    #4a6278;
  --border:      #0d3652;
  --shadow:      0 4px 24px rgba(0,0,0,0.5);
  --radius:      10px;
  --radius-sm:   6px;
  --transition:  0.2s ease;
  --sidebar-w:   240px;
  --danger:      #ef4444;
  --warning:     #f59e0b;
  --success:     #22c55e;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; inset: 0; z-index: 200; width: var(--sidebar-w); }
}

/* ─── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand .logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--mint), var(--prussian));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.sidebar-brand span { font-weight: 700; font-size: 1rem; color: var(--text); }
.sidebar-brand small { display: block; font-size: 0.7rem; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 0.8rem 0; }

.nav-section-label {
  padding: 8px 1.4rem 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  font-size: 0.9rem;
  user-select: none;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { color: var(--text); background: var(--bg-card); }
.nav-item.active { color: var(--mint); border-left-color: var(--mint); background: rgba(45,212,191,0.08); }

.sidebar-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sidebar-footer .user-info { display: flex; align-items: center; gap: 8px; }
.sidebar-footer .user-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--mint-dark), var(--prussian));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff; font-weight: 600;
}

/* ─── Main content ────────────────────────────────────────────────────────────── */
.admin-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-topbar h1 { font-size: 1.1rem; font-weight: 600; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.admin-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}

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

.card-header h3 { font-size: 1rem; font-weight: 600; }

/* ─── Stats grid ─────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card .stat-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--mint);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  white-space: nowrap;
}

.btn-primary  { background: var(--mint); color: var(--prussian); }
.btn-primary:hover  { background: var(--mint-light); transform: translateY(-1px); }

.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--mint); color: var(--mint); }

.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,0.1); }

.btn-ghost { background: none; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }

.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn svg { width: 14px; height: 14px; }

/* ─── Inputs / Forms ─────────────────────────────────────────────────────────── */
.input, .select, .textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.9rem;
  width: 100%;
  transition: border-color var(--transition);
  font-family: inherit;
}

.input::placeholder, .textarea::placeholder { color: var(--text-dim); }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(45,212,191,0.1);
}

.textarea { resize: vertical; min-height: 100px; }

.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-hint  { font-size: 0.75rem; color: var(--text-dim); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: all var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: all var(--transition);
}

.toggle input:checked + .toggle-slider { background: var(--mint); border-color: var(--mint); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--prussian); }

/* ─── Photo grid (admin) ─────────────────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.photo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.photo-card:hover { border-color: var(--mint); }
.photo-card.selected { border-color: var(--mint); outline: 2px solid rgba(45,212,191,0.3); }

.photo-card-img {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.photo-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}

.photo-card:hover .photo-card-img img { transform: scale(1.06); }

.photo-card-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(1,14,26,0.7);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.photo-card.selected .photo-card-checkbox {
  background: var(--mint);
  border-color: var(--mint);
}

.photo-card-status {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-published { background: rgba(34,197,94,0.2); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.status-draft     { background: rgba(245,158,11,0.2); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.status-archived  { background: rgba(107,114,128,0.2); color: #6b7280; border: 1px solid rgba(107,114,128,0.3); }

.photo-card-info {
  padding: 10px;
}

.photo-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.photo-card-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.photo-card-actions {
  display: flex;
  gap: 4px;
  padding: 0 10px 10px;
}

/* ─── Upload zone ────────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--mint);
  background: rgba(45,212,191,0.05);
}

.upload-zone svg { width: 48px; height: 48px; color: var(--text-dim); margin: 0 auto 1rem; display: block; }
.upload-zone h3  { font-size: 1.1rem; margin-bottom: 6px; }
.upload-zone p   { color: var(--text-muted); font-size: 0.85rem; }
.upload-zone .upload-browse { color: var(--mint); cursor: pointer; font-weight: 600; }

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 1rem;
}

.upload-preview-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-card);
}

.upload-preview-item img { width: 100%; height: 100%; object-fit: cover; }

.upload-preview-progress {
  position: absolute;
  inset: 0;
  background: rgba(1,14,26,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.upload-preview-progress .progress-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--mint);
  animation: spin 0.7s linear infinite;
}

.upload-preview-item .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239,68,68,0.8);
  border: none;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
}

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

/* ─── Modal ──────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

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

.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }
.modal-close:hover { color: var(--text); }

.modal-body    { padding: 1.4rem; }
.modal-footer  {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ─── Table ──────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:hover { background: var(--bg-hover); }
tbody td { padding: 10px 12px; color: var(--text); }

/* ─── Bulk actions bar ───────────────────────────────────────────────────────── */
.bulk-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg-card);
  border: 1px solid var(--mint);
  border-radius: var(--radius);
  padding: 10px 1.2rem;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1rem 0;
  backdrop-filter: blur(8px);
}

.bulk-bar .selected-count { font-size: 0.85rem; color: var(--mint); font-weight: 600; flex: 1; }

/* ─── Tags input ─────────────────────────────────────────────────────────────── */
.tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: text;
  transition: border-color var(--transition);
}

.tags-input:focus-within { border-color: var(--mint); }

.tag-chip {
  background: rgba(45,212,191,0.15);
  color: var(--mint);
  border: 1px solid rgba(45,212,191,0.3);
  border-radius: 12px;
  padding: 2px 8px 2px 10px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tag-chip button {
  background: none;
  border: none;
  color: currentColor;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  opacity: 0.6;
}

.tag-chip button:hover { opacity: 1; }

.tags-text-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.85rem;
  min-width: 100px;
  flex: 1;
}

/* ─── Notifications ──────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--mint);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.85rem;
  min-width: 250px;
  max-width: 380px;
  animation: slideIn 0.3s ease;
  color: var(--text);
}

.toast-item.success { border-left-color: var(--success); }
.toast-item.error   { border-left-color: var(--danger); }
.toast-item.warning { border-left-color: var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ─── Login page ─────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 50%, var(--bg-surface) 0%, var(--bg) 70%);
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--mint), var(--prussian));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.login-logo h1 { font-size: 1.4rem; }
.login-logo small { display: block; font-size: 0.75rem; color: var(--text-muted); }

.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}

.login-error.show { display: block; }

.login-card .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* Scroll ─────────────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--prussian); border-radius: 3px; }
