/* ============================================================
   NxtGen Exhibit — Custom Styles
   ============================================================ */

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

:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(30, 30, 60, 0.6);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #e8e8f0;
  --text-secondary: #9898b0;
  --text-muted: #6b6b85;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --gradient-primary: linear-gradient(135deg, #6366f1, #a855f7, #06b6d4);
  --gradient-warm: linear-gradient(135deg, #f43f5e, #f59e0b);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

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

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ---- Glass Card ---- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
}

.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

/* ---- Gradient Text ---- */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Buttons ---- */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(244, 63, 94, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.35);
}

.btn-sm { padding: 6px 14px; font-size: 0.75rem; }
.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---- Form elements ---- */
.form-input {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  width: 100%;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.form-input::placeholder { color: var(--text-muted); }

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-select {
  appearance: none;
  background: var(--bg-glass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239898b0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 36px 10px 14px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.3s ease;
}
.form-select:focus {
  outline: none;
  border-color: var(--accent-indigo);
}

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

/* ---- Layout ---- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-glass);
}

.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  margin-bottom: 2px;
}
.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}
.nav-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-indigo);
}
.nav-item svg, .nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-glass);
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
}

.content-header {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(15, 15, 26, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.content-body {
  padding: 32px;
}

/* ---- Floor Plan ---- */
.floor-grid {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.stall-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  position: relative;
  border: 2px solid transparent;
  min-height: 90px;
}
.stall-cell:hover {
  transform: scale(1.04);
  z-index: 2;
}

.stall-available {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
}
.stall-available:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 20px rgba(255,255,255,0.06);
}

.stall-blocked {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
}
.stall-blocked:hover {
  background: rgba(16, 185, 129, 0.18);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.stall-sold {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.4);
  color: var(--accent-rose);
}
.stall-sold:hover {
  background: rgba(244, 63, 94, 0.18);
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.15);
}

.stall-label {
  font-size: 1rem;
  font-weight: 700;
}
.stall-type {
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.7;
  margin-top: 2px;
}
.stall-price {
  font-size: 0.65rem;
  font-weight: 500;
  margin-top: 4px;
  opacity: 0.8;
}

/* ---- Stats cards ---- */
.stat-card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  transition: all 0.3s ease;
}
.stat-card:hover {
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: slideUp 0.3s ease;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ---- Badge / Pill ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-available { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.badge-blocked { background: rgba(16,185,129,0.15); color: var(--accent-emerald); }
.badge-sold { background: rgba(244,63,94,0.15); color: var(--accent-rose); }
.badge-open { background: rgba(245,158,11,0.15); color: var(--accent-amber); }
.badge-closed { background: rgba(16,185,129,0.15); color: var(--accent-emerald); }
.badge-pending { background: rgba(99,102,241,0.15); color: var(--accent-indigo); }
.badge-approved { background: rgba(16,185,129,0.15); color: var(--accent-emerald); }
.badge-vip { background: rgba(168,85,247,0.15); color: var(--accent-purple); }

/* ---- Table ---- */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
}
.data-table td {
  padding: 12px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-secondary);
}
.data-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fadeIn { animation: fadeIn 0.4s ease; }
.animate-slideUp { animation: slideUp 0.4s ease; }
.animate-slideIn { animation: slideIn 0.3s ease; }
.animate-pulse { animation: pulse 2s infinite; }

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  animation: slideIn 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  max-width: 360px;
}
.toast-success {
  background: rgba(16, 185, 129, 0.9);
  color: white;
}
.toast-error {
  background: rgba(244, 63, 94, 0.9);
  color: white;
}
.toast-info {
  background: rgba(99, 102, 241, 0.9);
  color: white;
}

/* ---- QR Badge ---- */
.qr-badge {
  background: white;
  padding: 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 280px;
  margin: 0 auto;
}
.qr-badge canvas { margin: 0 auto; }

/* ---- Marketing Poster ---- */
.poster-preview {
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  color: white;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* ---- Treasure Hunt Progress ---- */
.hunt-progress {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hunt-stall {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--border-glass);
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 100px;
  text-align: center;
  transition: all 0.3s ease;
}
.hunt-stall.visited {
  border-style: solid;
  border-color: var(--accent-emerald);
  background: rgba(16,185,129,0.1);
  color: var(--accent-emerald);
}
.hunt-stall.unvisited {
  color: var(--text-muted);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .content-body {
    padding: 16px;
  }
  .content-header {
    padding: 16px;
  }
}

/* ---- Login Page ---- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}
.login-wrapper::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,0.15), transparent 70%);
  top: -100px;
  right: -100px;
}
.login-wrapper::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(168,85,247,0.1), transparent 70%);
  bottom: -50px;
  left: -50px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  position: relative;
  z-index: 1;
}

/* ---- Role Selector ---- */
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.role-option {
  padding: 16px 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-glass);
  background: var(--bg-glass);
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
  font-size: 0.8rem;
  font-weight: 600;
}
.role-option:hover {
  border-color: rgba(99,102,241,0.4);
  background: rgba(99,102,241,0.06);
}
.role-option.selected {
  border-color: var(--accent-indigo);
  background: rgba(99,102,241,0.1);
  color: var(--accent-indigo);
}
.role-option .role-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ---- Mobile menu toggle ---- */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 50;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--text-primary);
  cursor: pointer;
}
@media (max-width: 768px) {
  .mobile-toggle { display: block; }
}
