/* ============================================
   LOCALDEALS - SHARED DESIGN SYSTEM
   Font: Clash Display + Satoshi
   Aesthetic: Modern fintech with warm punch
   ============================================ */

@import url('https://api.fontshare.com/v2/css?f[]=clash-display@400,500,600,700&f[]=satoshi@400,500,700&display=swap');

:root {
  --primary: #FF6B2B;
  --secondary: #1A1A2E;
  --accent: #F7C948;
  --primary-light: #FF8C5A;
  --primary-dark: #E5521A;
  --surface: #FFFFFF;
  --surface-2: #F8F7F4;
  --surface-3: #F0EDE8;
  --text-1: #0F0F14;
  --text-2: #4A4A5A;
  --text-3: #9494A8;
  --border: #E8E6E0;
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-primary: 0 8px 24px rgba(255,107,43,0.30);
  --font-display: 'Clash Display', sans-serif;
  --font-body: 'Satoshi', sans-serif;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--surface-2);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5 { font-family: var(--font-display); line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); font-weight: 600; }
p  { color: var(--text-2); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-md);
  font-family: var(--font-body); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; border: none; text-decoration: none;
  transition: var(--transition); white-space: nowrap; position: relative;
  overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0); transition: var(--transition);
}
.btn:hover::after { background: rgba(255,255,255,0.12); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-secondary {
  background: var(--secondary); color: #fff;
}
.btn-secondary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-accent {
  background: var(--accent); color: var(--secondary);
}
.btn-accent:hover { filter: brightness(1.05); transform: translateY(-1px); }

.btn-outline {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text-1); }

.btn-danger {
  background: var(--error); color: #fff;
}
.btn-success {
  background: var(--success); color: #fff;
}
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-icon { padding: 10px; min-width: 40px; justify-content: center; }
.btn-full { width: 100%; justify-content: center; }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-weight: 600; font-size: 0.85rem;
  color: var(--text-2); margin-bottom: 6px; letter-spacing: 0.3px;
}
.form-control {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-md);
  border: 1.5px solid var(--border); background: var(--surface);
  font-family: var(--font-body); font-size: 0.95rem; color: var(--text-1);
  transition: var(--transition); outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,43,0.12);
}
.form-control::placeholder { color: var(--text-3); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

.form-hint { font-size: 0.8rem; color: var(--text-3); margin-top: 5px; }
.form-error { font-size: 0.8rem; color: var(--error); margin-top: 5px; }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: 20px 24px 0; display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}
.card-body { padding: 20px 24px; }
.card-footer {
  padding: 16px 24px; background: var(--surface-2);
  border-top: 1px solid var(--border);
}

/* ============================================
   TABLES
   ============================================ */
.table-wrapper { overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.table th {
  padding: 12px 16px; font-weight: 600; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-3); background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
  text-align: left;
}
.table td {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-2); }

/* ============================================
   BADGES & STATUS
   ============================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.badge-success { background: #DCFCE7; color: #166534; }
.badge-warning { background: #FEF9C3; color: #92400E; }
.badge-error   { background: #FEE2E2; color: #991B1B; }
.badge-info    { background: #DBEAFE; color: #1E40AF; }
.badge-neutral { background: var(--surface-3); color: var(--text-2); }
.badge-primary { background: rgba(255,107,43,0.12); color: var(--primary); }

/* ============================================
   ALERTS
   ============================================ */
.alert {
  padding: 14px 18px; border-radius: var(--radius-md);
  font-size: 0.9rem; font-weight: 500; display: flex;
  align-items: flex-start; gap: 10px; margin-bottom: 16px;
}
.alert-success { background: #DCFCE7; color: #166534; border-left: 4px solid var(--success); }
.alert-error   { background: #FEE2E2; color: #991B1B; border-left: 4px solid var(--error); }
.alert-warning { background: #FEF9C3; color: #92400E; border-left: 4px solid var(--warning); }
.alert-info    { background: #DBEAFE; color: #1E40AF; border-left: 4px solid var(--info); }
.alert-info    { background: #DBEAFE; color: #1E40AF; border-left: 4px solid var(--info); }

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 24px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 16px;
}
.stat-card .stat-value {
  font-family: var(--font-display); font-size: 2rem;
  font-weight: 700; color: var(--text-1); line-height: 1;
}
.stat-card .stat-label {
  font-size: 0.85rem; color: var(--text-3); margin-top: 4px;
  font-weight: 500;
}
.stat-card .stat-change {
  font-size: 0.78rem; font-weight: 600; margin-top: 8px;
}
.stat-card .stat-change.up   { color: var(--success); }
.stat-card .stat-change.down { color: var(--error); }
.stat-card::after {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 100px; height: 100px; border-radius: 50%;
  background: var(--primary); opacity: 0.04; pointer-events: none;
}

/* ============================================
   SIDEBAR LAYOUT
   ============================================ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px; background: var(--secondary); color: #fff;
  display: flex; flex-direction: column; position: fixed;
  top: 0; left: 0; height: 100vh; z-index: 100;
  transition: var(--transition-slow); overflow-y: auto;
}
.sidebar-logo {
  padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo .logo-mark {
  width: 36px; height: 36px; background: var(--primary);
  border-radius: var(--radius-sm); display: flex; align-items: center;
  justify-content: center; font-family: var(--font-display);
  font-weight: 700; font-size: 1.1rem; color: #fff;
}
.sidebar-logo .logo-text {
  font-family: var(--font-display); font-size: 1.2rem;
  font-weight: 700; color: #fff;
}

.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-section { margin-bottom: 8px; }
.nav-section-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,0.3); padding: 8px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-md);
  color: rgba(255,255,255,0.65); text-decoration: none;
  font-size: 0.9rem; font-weight: 500; transition: var(--transition);
  cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 12px rgba(255,107,43,0.4);
}
.nav-item .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--primary); color: #fff;
  font-size: 0.7rem; font-weight: 700; padding: 2px 7px;
  border-radius: 100px; min-width: 20px; text-align: center;
}

.sidebar-footer {
  padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.08);
}

.main-content {
  flex: 1; margin-left: 260px; display: flex;
  flex-direction: column; min-height: 100vh;
}

.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 64px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.page-content { padding: 28px; flex: 1; }

/* ============================================
   MOBILE SIDEBAR TOGGLE
   ============================================ */
.menu-toggle {
  display: none; background: none; border: none;
  font-size: 1.4rem; cursor: pointer; color: var(--text-1); padding: 6px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .page-content { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 99;
  }
  .sidebar-overlay.visible { display: block; }
}

/* ============================================
   UTILITIES
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-3); }
.text-small  { font-size: 0.85rem; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.font-bold { font-weight: 700; }
.font-display { font-family: var(--font-display); }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

.w-full { width: 100%; }
.hidden { display: none !important; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* ============================================
   AVATAR
   ============================================ */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
  overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.3rem; }
.avatar-sm { width: 28px; height: 28px; font-size: 0.75rem; }

/* ============================================
   MODAL
   ============================================ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 200; display: flex; align-items: center;
  justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface); border-radius: var(--radius-xl);
  width: 100%; max-width: 520px; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 24px 24px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-body   { padding: 20px 24px; }
.modal-footer { padding: 0 24px 24px; display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================
   LOADER
   ============================================ */
.spinner {
  width: 24px; height: 24px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-3);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { color: var(--text-2); margin-bottom: 8px; }

/* ============================================
   UPLOAD AREA
   ============================================ */
.upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 32px 20px; text-align: center; cursor: pointer;
  transition: var(--transition); background: var(--surface-2);
}
.upload-area:hover { border-color: var(--primary); background: rgba(255,107,43,0.04); }
.upload-area.dragover { border-color: var(--primary); background: rgba(255,107,43,0.08); }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex; align-items: center; gap: 4px;
  justify-content: center; padding: 20px 0;
}
.page-btn {
  min-width: 36px; height: 36px; display: flex; align-items: center;
  justify-content: center; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text-2); text-decoration: none; transition: var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--secondary); color: #fff;
  padding: 14px 20px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); font-size: 0.9rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s ease; max-width: 320px;
  border-left: 4px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
