/* ==========================================================================
   Izzi Catalog - Refined Professional Design System
   Restrained, Tactile, Modern Monochromatic & Slate Aesthetic
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root,
[data-theme="dark"],
[data-theme="dark_luxury"] {
  /* 1. DARK OBSIDIAN (Default Dark Mode) */
  --bg-page: #0d0f12;
  --bg-surface: #14171c;
  --bg-surface-subtle: #191d24;
  --bg-surface-hover: #20252e;

  --border-subtle: #242933;
  --border-strong: #333a47;
  --border-focus: #4f46e5;

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-primary-subtle: rgba(59, 130, 246, 0.12);

  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.1);
  --color-success-border: rgba(16, 185, 129, 0.25);

  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.1);
  --color-warning-border: rgba(245, 158, 11, 0.25);

  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.1);
  --color-danger-border: rgba(239, 68, 68, 0.25);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-overlay: 0 20px 45px rgba(0, 0, 0, 0.6);

  --transition: 0.16s ease;
}

/* 2. CLEAN STUDIO (Light Mode) */
[data-theme="light"],
[data-theme="clean_light"] {
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f1f5f9;
  --bg-surface-hover: #e2e8f0;

  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-primary-subtle: rgba(37, 99, 235, 0.08);

  --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-overlay: 0 16px 36px rgba(0, 0, 0, 0.12);
}

/* 3. WARM SAND (Artisan Earth & Linen) */
[data-theme="warm_sand"],
[data-theme="warm_earth"] {
  --bg-page: #f7f4ee;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #efe9dc;
  --bg-surface-hover: #e5ddcd;

  --border-subtle: #e2d7c5;
  --border-strong: #cfbeaa;
  --border-focus: #92400e;

  --text-main: #292524;
  --text-muted: #78716c;
  --text-dim: #a8a29e;

  --accent-primary: #92400e;
  --accent-primary-hover: #78350f;
  --accent-primary-subtle: rgba(146, 64, 14, 0.08);

  --shadow-subtle: 0 1px 3px rgba(41, 37, 36, 0.05);
  --shadow-card: 0 4px 14px rgba(41, 37, 36, 0.07);
  --shadow-overlay: 0 16px 36px rgba(41, 37, 36, 0.14);
}

/* 4. MIDNIGHT BLUE (Deep Sapphire & Navy) */
[data-theme="midnight_blue"],
[data-theme="cyberpunk"] {
  --bg-page: #060b17;
  --bg-surface: #0c1427;
  --bg-surface-subtle: #131f3b;
  --bg-surface-hover: #192a50;

  --border-subtle: #1c2e56;
  --border-strong: #2a437a;
  --border-focus: #38bdf8;

  --text-main: #f0f6fc;
  --text-muted: #8ba2c4;
  --text-dim: #5a759c;

  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-primary-subtle: rgba(2, 132, 199, 0.14);

  --shadow-subtle: 0 1px 3px rgba(2, 6, 23, 0.4);
  --shadow-card: 0 4px 18px rgba(2, 6, 23, 0.5);
  --shadow-overlay: 0 20px 45px rgba(2, 6, 23, 0.7);
}

/* 5. FOREST EMERALD (Sage Nature & Botani) */
[data-theme="forest_emerald"] {
  --bg-page: #06120b;
  --bg-surface: #0c1e13;
  --bg-surface-subtle: #122a1c;
  --bg-surface-hover: #183825;

  --border-subtle: #1c3e29;
  --border-strong: #2a5a3c;
  --border-focus: #10b981;

  --text-main: #ecfdf5;
  --text-muted: #86efac;
  --text-dim: #4ade80;

  --accent-primary: #059669;
  --accent-primary-hover: #047857;
  --accent-primary-subtle: rgba(5, 150, 105, 0.14);

  --shadow-subtle: 0 1px 3px rgba(6, 18, 11, 0.4);
  --shadow-card: 0 4px 18px rgba(6, 18, 11, 0.5);
  --shadow-overlay: 0 20px 45px rgba(6, 18, 11, 0.7);
}

/* 6. EDITORIAL ROSE (Blush Champagne & Plum) */
[data-theme="editorial_rose"] {
  --bg-page: #13080e;
  --bg-surface: #1e0d16;
  --bg-surface-subtle: #2b1420;
  --bg-surface-hover: #381a2b;

  --border-subtle: #411f32;
  --border-strong: #5c2d47;
  --border-focus: #f43f5e;

  --text-main: #fff1f2;
  --text-muted: #fda4af;
  --text-dim: #fb7185;

  --accent-primary: #e11d48;
  --accent-primary-hover: #be123c;
  --accent-primary-subtle: rgba(225, 29, 72, 0.14);

  --shadow-subtle: 0 1px 3px rgba(19, 8, 14, 0.4);
  --shadow-card: 0 4px 18px rgba(19, 8, 14, 0.5);
  --shadow-overlay: 0 20px 45px rgba(19, 8, 14, 0.7);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.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-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* Clean Navigation Header */
.app-header, .admin-nav {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--text-main);
  color: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* Directory Selector Dropdown / Pill */
.directory-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.directory-pill:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.view-live-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-primary);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.view-live-link:hover {
  background: var(--accent-primary-subtle);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--text-main);
  color: var(--bg-page);
  border-color: var(--text-main);
}
.btn-primary:hover {
  background: #e5e7eb;
  border-color: #e5e7eb;
}

.btn-secondary {
  background: var(--bg-surface-subtle);
  border-color: var(--border-subtle);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: #f87171;
}
.btn-danger:hover {
  background: var(--color-danger);
  color: white;
}

.btn-success {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: #34d399;
}
.btn-success:hover {
  background: var(--color-success);
  color: white;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Cards & Panels */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-subtle);
}

/* Metrics Row */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  cursor: pointer;
}
.stat-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-subtle);
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Clean Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
}
.badge-available {
  background: var(--color-success-bg);
  color: #34d399;
  border: 1px solid var(--color-success-border);
}
.badge-pending {
  background: var(--color-warning-bg);
  color: #fbbf24;
  border: 1px solid var(--color-warning-border);
}
.badge-disabled {
  background: var(--color-danger-bg);
  color: #f87171;
  border: 1px solid var(--color-danger-border);
}
.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: currentColor;
}

/* Refined Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: var(--bg-surface-subtle);
  padding: 10px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tr.clickable-row {
  cursor: pointer;
  transition: background var(--transition);
}

.data-table tr.clickable-row:hover {
  background: var(--bg-surface-subtle);
}

.table-thumbnail {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
}

/* Clean Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--text-muted);
  background: var(--bg-surface);
}

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

/* Image Upload Area */
.upload-dropzone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  background: var(--bg-surface-subtle);
  cursor: pointer;
  transition: var(--transition);
}

.upload-dropzone:hover {
  border-color: var(--text-muted);
  background: var(--bg-surface-hover);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-strong);
  border-radius: var(--radius-full);
  transition: var(--transition);
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: var(--transition);
}
input:checked + .toggle-slider {
  background-color: var(--accent-primary);
}
input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-overlay);
  padding: 24px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.modal-close:hover {
  background: var(--bg-surface-subtle);
  color: var(--text-main);
}

/* Nav Tabs */
.nav-tabs {
  display: inline-flex;
  background: var(--bg-surface-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 2px;
}

.nav-tab-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.nav-tab-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-subtle);
}

.nav-tab-btn:hover:not(.active) {
  color: var(--text-main);
}

/* Toast Container */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
}
.toast.success { border-left: 3px solid var(--color-success); }
.toast.error { border-left: 3px solid var(--color-danger); }
.toast.info { border-left: 3px solid var(--accent-primary); }
