/* ============================================================
   styles.css — Global Dark Theme
   ============================================================ */

:root {
  --primary: #D4AF37;
  --primary-alt: #F4E4C1;
  --primary-dark: #C9A961;
  --secondary: #D4AF37;
  --primary-gradient: linear-gradient(135deg, #D4AF37, #C9A961);
  --bg-950: #0a0a0a;
  --bg-900: #1a1a1a;
  --bg-800: #2a2a2a;
  --bg-700: #3a3a3a;
  --neutral-600: #525252;
  --neutral-500: #737373;
  --neutral-400: #a3a3a3;
  --neutral-300: #d4d4d4;
  --white: #ffffff;
  --red: #ef4444;
  --blue: #3b82f6;
  --orange: #f59e0b;
  --green: #22c55e;
}

/* Light theme variables */
[data-theme="light"] {
  --bg-950: #f8fafc;
  --bg-900: #e2e8f0;
  --bg-800: #cbd5e1;
  --bg-700: #94a3b8;
  --neutral-600: #64748b;
  --neutral-500: #475569;
  --neutral-400: #334155;
  --neutral-300: #1e293b;
  --white: #0f172a;
  --red: #dc2626;
  --blue: #2563eb;
  --orange: #ea580c;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'lnum';
  font-size: 1rem;
  line-height: 1.6;
  background: var(--bg-950);
  color: var(--white);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-900); }
::-webkit-scrollbar-thumb { background: var(--bg-700); border-radius: 3px; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* ---- Typography ---- */
h1 { font-size: clamp(2rem, 5vw, 4rem); font-weight: 900; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.flex-1 { flex: 1; }
.grid { display: grid; }
.hidden { display: none !important; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.uppercase { text-transform: uppercase; }
.pointer { cursor: pointer; }
.select-none { user-select: none; }

/* ---- Colors ---- */
.text-primary { color: var(--primary); }
.text-white { color: var(--white); }
.text-neutral-400 { color: var(--neutral-400); }
.text-neutral-500 { color: var(--neutral-500); }
.bg-primary { background: var(--primary); }
.bg-primary-gradient { background: var(--primary-gradient); }

/* ---- Cards ---- */
.card {
  background: var(--bg-900);
  border: 1px solid var(--bg-800);
  border-radius: 1.5rem;
  padding: 2rem;
}
.card-sm { padding: 1.25rem; border-radius: 1rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: 0.75rem;
  font-weight: 700; font-size: 1rem; cursor: pointer;
  border: none; transition: all 0.2s; text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover:not(:disabled) { opacity: 0.9; transform: scale(1.02); }
.btn-primary-gradient { background: var(--primary-gradient); color: #000; }
.btn-secondary { background: var(--bg-800); color: var(--white); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-700); }
.btn-danger { background: transparent; color: var(--red); }
.btn-danger:hover { background: rgba(239,68,68,0.1); }
.btn-ghost { background: transparent; color: var(--neutral-400); border: 1px solid var(--bg-800); }
.btn-ghost:hover { background: var(--bg-900); color: var(--white); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.75rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-icon { padding: 0.5rem; border-radius: 0.75rem; }
.btn-full { width: 100%; justify-content: center; }

/* ---- Inputs ---- */
.input, .textarea, .select {
  width: 100%; background: #000;
  border: 1px solid var(--bg-800); border-radius: 0.75rem;
  padding: 1rem; color: var(--white);
  font-size: 1rem; outline: none; transition: border-color 0.2s;
  font-family: inherit;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); }
.textarea { resize: vertical; min-height: 80px; }
.select option { background: var(--bg-900); }
.input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.input-label { font-size: 0.9rem; color: var(--neutral-500); font-weight: 500; }

/* ---- Light theme form fields ---- */
[data-theme="light"] .input,
[data-theme="light"] .textarea,
[data-theme="light"] .select {
  background: #ffffff;
  border-color: #cbd5e1;
  color: var(--white);
}
[data-theme="light"] .input::placeholder,
[data-theme="light"] .textarea::placeholder,
[data-theme="light"] .select::placeholder {
  color: var(--neutral-500);
}

/* ---- Toggle Switch ---- */
.toggle {
  position: relative; width: 2.5rem; height: 1.25rem;
  background: var(--bg-800); border-radius: 9999px;
  cursor: pointer; transition: background 0.2s; border: none; flex-shrink: 0;
}
.toggle.on { background: var(--primary); }
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 0.875rem; height: 0.875rem; border-radius: 50%;
  background: #000; transition: transform 0.2s;
}
.toggle.on::after { transform: translateX(1.25rem); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.hidden { display: none !important; }
.modal {
  background: var(--bg-900); border: 1px solid var(--bg-800);
  border-radius: 1.5rem; padding: 2rem; width: 100%;
  max-height: 90vh; overflow-y: auto;
  animation: fadeIn 0.2s ease;
}
.modal-sm { max-width: 28rem; }
.modal-md { max-width: 42rem; }
.modal-lg { max-width: 56rem; }
.modal-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 1.5rem;
}

/* ---- Badge ---- */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.6rem; border-radius: 9999px;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-new      { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.badge-preparing{ background: rgba(107,114,128,0.1); color: var(--neutral-500); border: 1px solid rgba(107,114,128,0.2); }
.badge-ready    { background: rgba(34,197,94,0.1); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.badge-completed{ background: var(--bg-800); color: var(--neutral-500); border: 1px solid var(--bg-700); }
.badge-primary  { background: rgba(163,230,53,0.1); color: var(--primary); border: 1px solid rgba(163,230,53,0.2); }

/* ---- Color Swatch ---- */
.color-swatch {
  width: 2rem; height: 2rem; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; transition: all 0.2s;
}
.color-swatch.active { border-color: white; transform: scale(1.15); }
.color-swatch:hover { transform: scale(1.1); }

/* ---- Image Upload ---- */
.image-preview {
  width: 8rem; height: 8rem; border-radius: 1rem;
  border: 1px solid var(--bg-800); background: #000;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.multi-image-thumb {
  position: relative; aspect-ratio: 16/9;
  border-radius: 0.75rem; overflow: hidden;
  border: 1px solid var(--bg-800); background: #000;
}
.multi-image-thumb img { width: 100%; height: 100%; object-fit: cover; }
.multi-image-thumb .remove-btn {
  position: absolute; top: 0.4rem; right: 0.4rem;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--red); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s; color: white; font-size: 12px;
}
.multi-image-thumb:hover .remove-btn { opacity: 1; }
.image-placeholder {
  border: 2px dashed var(--bg-800); border-radius: 1rem;
  padding: 2rem; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--neutral-600); gap: 0.5rem;
}

.admin-sidebar {
  width: 16rem;
  border-right: 1px solid var(--bg-800);
  display: flex;
  flex-direction: column;
  background: var(--bg-950);
  position: sticky;
  top: 0;
  left: 0;
  right: auto;
  inset-inline-start: 0;
  inset-inline-end: auto;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  direction: ltr;
  box-sizing: border-box;
}
html[dir="rtl"] .admin-sidebar {
  margin-inline-start: 0 !important;
  margin-inline-end: auto !important;
}
html[dir="rtl"] #admin-shell > div {
  direction: ltr !important;
}
.admin-sidebar .sidebar-top {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
}
.admin-sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.admin-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s;
  color: var(--neutral-400);
  background: transparent;
}
.admin-sidebar .nav-item.active {
  color: #000;
  background: var(--primary);
}
.admin-sidebar-admin-section {
  border-top: 1px solid var(--bg-800);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.admin-sidebar-footer {
  padding: 1rem 1rem 1.25rem;
  border-top: 1px solid var(--bg-800);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}
.admin-sidebar-user-card {
  padding: 0.9rem 1rem;
  border-radius: 0.95rem;
  background: rgba(163,230,53,0.08);
  border: 1px solid rgba(163,230,53,0.22);
}
.admin-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  background: transparent;
  border: 1px solid var(--bg-800);
  color: var(--neutral-400);
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}
.admin-sidebar-btn:hover {
  background: var(--bg-800);
}
.admin-sidebar-btn-secondary {
  color: var(--primary);
}
.admin-sidebar-btn-danger {
  color: #ef4444;
}
.admin-sidebar-btn-danger:hover {
  background: rgba(239,68,68,0.1);
}
.admin-sidebar .theme-icon {
  display: inline-flex;
  align-items: center;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .card { padding: 1.25rem; }
  .modal { padding: 1.5rem; }
  .hide-mobile { display: none !important; }
  .grid-cols-2-mobile { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 0.75rem; }
  #sidebar-overlay { transition: opacity 0.3s ease; }
}
@media (min-width: 768px) {
  .show-mobile { display: none !important; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Section Borders ---- */
.section-bordered {
  border: 1px solid var(--bg-800);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
}
