/* ===== MODERN DARK THEME - INVENTORY SYSTEM ===== */

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

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

:root {
  --primary: #0a0a0a;
  --accent: #22c55e;
  --accent-hover: #4ade80;
  --accent-dim: #16a34a;
  --surface: #141414;
  --surface-light: #1f1f1f;
  --surface-lighter: #2a2a2a;
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.1);
  --text: #fafafa;
  --text-dim: #a1a1aa;
  --text-muted: #71717a;
  --danger: #ef4444;
  --danger-hover: #f87171;
  --warning: #f59e0b;
}

/* Light Mode */
:root[data-theme="light"],
html[data-theme="light"] {
  --primary: #f8fafc;
  --accent: #16a34a;
  --accent-hover: #22c55e;
  --accent-dim: #15803d;
  --surface: #ffffff;
  --surface-light: #f1f5f9;
  --surface-lighter: #e2e8f0;
  --border: rgba(0,0,0,0.08);
  --border-light: rgba(0,0,0,0.12);
  --text: #0f172a;
  --text-dim: #475569;
  --text-muted: #94a3b8;
  --danger: #dc2626;
  --danger-hover: #ef4444;
  --warning: #d97706;
}

[data-theme="light"] .bg-gradient {
  background: 
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(34, 197, 94, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(34, 197, 94, 0.05) 0%, transparent 50%),
    var(--primary);
}

[data-theme="light"] .grid-overlay {
  background-image: 
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
}

[data-theme="light"] nav {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .nav-links a {
  color: #475569;
}

[data-theme="light"] .nav-links a:hover {
  color: #0f172a;
  background: var(--surface-light);
}

[data-theme="light"] .nav-links a.active {
  color: var(--accent);
  background: rgba(22, 163, 74, 0.1);
}

[data-theme="light"] .user-greeting {
  color: #475569;
}

[data-theme="light"] .btn-ghost {
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .btn-ghost:hover {
  background: #f1f5f9;
}

[data-theme="light"] input[type="date"] {
  color-scheme: light;
}

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

/* ===== BACKGROUND EFFECTS ===== */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(34, 197, 94, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(34, 197, 94, 0.08) 0%, transparent 50%),
    var(--primary);
  pointer-events: none;
}

.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-image: 
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* ===== NAVIGATION ===== */
nav {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 20px 48px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(10px);
}

.nav-logo {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  text-decoration: none;
}

.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-light);
}

.nav-links a.active {
  color: var(--accent);
  background: rgba(34, 197, 94, 0.1);
}

.nav-auth {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-greeting {
  font-size: 14px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-greeting svg {
  color: var(--accent);
}

.btn {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-light);
  border-color: var(--border-light);
}

.btn-primary {
  background: var(--accent);
  color: var(--primary);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.2);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-warning {
  background: var(--warning);
  color: var(--primary);
}

.btn-warning:hover {
  background: #fbbf24;
}

.btn-sm {
  font-size: 13px;
  padding: 8px 14px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  position: relative;
  z-index: 10;
  min-height: calc(100vh - 70px);
  padding: 48px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.page-header {
  text-align: center;
  margin-bottom: 48px;
}

.page-tag {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding: 8px 16px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(34, 197, 94, 0.2);
  display: inline-block;
}

.page-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.page-subtitle {
  font-size: 16px;
  color: var(--text-dim);
  font-weight: 300;
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-icon {
  width: 40px;
  height: 40px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
}

/* ===== FORMS ===== */
input, select, textarea {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  padding: 14px 18px;
  background: var(--surface-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text);
  transition: all 0.2s ease;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

input::placeholder {
  color: var(--text-muted);
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

/* ===== TABLES ===== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: var(--surface-lighter);
}

th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-light);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

tbody tr {
  transition: background 0.15s ease;
  background: var(--surface);
}

tbody tr:nth-child(odd) {
  background: var(--surface-light);
}

tbody tr:hover {
  background: var(--surface-lighter);
}

/* Duplicate row highlighting */
tbody tr.duplicate {
  background: rgba(239, 68, 68, 0.15);
}

tbody tr.duplicate:nth-child(odd) {
  background: rgba(239, 68, 68, 0.18);
}

tbody tr.duplicate:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* ===== SEARCH BOX ===== */
.search-container {
  max-width: 500px;
  margin: 0 auto 32px auto;
}

.search-box {
  position: relative;
}

.search-box input {
  padding-left: 48px;
}

.search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* ===== BUTTONS ROW ===== */
.actions-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

/* ===== ADMIN GRID ===== */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  transition: all 0.3s ease;
}

.admin-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.admin-card-icon {
  width: 64px;
  height: 64px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  font-size: 28px;
}

.admin-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.admin-card p {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* ===== ALERTS ===== */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--accent);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

/* ===== VIEW IMAGES BUTTON ===== */
button.view-images {
  padding: 6px 12px;
  font-size: 13px;
  background: var(--accent);
  color: var(--primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

button.view-images:hover {
  background: var(--accent-hover);
}

/* ===== LINK ICON ===== */
a.link-icon {
  font-size: 16px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

a.link-icon:hover {
  opacity: 1;
}

/* ===== DATE INPUTS ===== */
input[type="date"] {
  color-scheme: dark;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  nav {
    padding: 16px 20px;
    flex-wrap: wrap;
    gap: 16px;
  }

  .nav-links {
    position: static;
    transform: none;
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .main-content {
    padding: 24px 16px;
  }

  .form-row {
    flex-direction: column;
  }
}

/* ===== THEME TOGGLE BUTTON (shared across nav and landing page) ===== */
.theme-toggle {
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--text);
}
.theme-toggle:hover {
  background: var(--surface-lighter);
  border-color: var(--accent);
}
.theme-toggle .sun-icon {
  display: none;
}
.theme-toggle .moon-icon {
  display: block;
}
[data-theme="light"] .theme-toggle .sun-icon {
  display: block;
}
[data-theme="light"] .theme-toggle .moon-icon {
  display: none;
}
