/* ========================================
   BAZAARX DESIGN SYSTEM & ANIMATIONS
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  /* Colors */
  --saffron: #FF6B00;
  --saffron-lt: #FF8C35;
  --saffron-pale: #FFF3EB;
  --emerald: #00875A;
  --emerald-lt: #00A36C;
  --emerald-pale: #E6F9F1;
  --sky: #0073E6;
  --sky-lt: #3390FF;
  --sky-pale: #E6F2FF;
  --violet: #7C3AED;
  --violet-pale: #F5F0FF;
  --amber: #D97706;
  --amber-pale: #FEF3C7;
  
  --ink: #0F0E0C;
  --ink-soft: #2C2A26;
  --ink-muted: #6B6760;
  --sand: #F5F1EB;
  --sand-dark: #E8E4DC;
  --white: #FFFFFF;
  
  /* Borders & Shadows */
  --border: rgba(15,14,12,0.10);
  --border-md: rgba(15,14,12,0.15);
  --shadow-sm: 0 2px 8px rgba(15,14,12,0.06);
  --shadow-md: 0 4px 20px rgba(15,14,12,0.08);
  --shadow-lg: 0 8px 40px rgba(15,14,12,0.12);
  --shadow-xl: 0 20px 60px rgba(15,14,12,0.15);
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --radius-pill: 100px;
  
  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--sand);
  color: var(--ink);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: center;
}

.logo span { color: var(--saffron); }
.logo.light { color: #fff; }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--saffron);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 3vw, 36px);
  color: var(--ink);
  letter-spacing: -0.5px;
  margin-bottom: 40px;
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */
.section { padding: 90px 5vw; }
.section-sm { padding: 60px 5vw; }

.app-shell {
  display: grid;
  min-height: 100vh;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

/* ========================================
   NAVIGATION
   ======================================== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  height: 64px;
  background: rgba(245,241,235,0.95);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s var(--ease-out);
}

.topnav.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--saffron);
  transition: width 0.3s var(--ease-out);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring);
}

.nav-avatar:hover {
  transform: scale(1.1);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  text-decoration: none;
  border: none;
  white-space: nowrap;
}

.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-md { padding: 12px 24px; font-size: 15px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }

.btn-primary {
  background: var(--saffron);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,107,0,0.25);
}

.btn-primary:hover {
  background: var(--saffron-lt);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,107,0,0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(15,14,12,0.04);
  border-color: var(--border-md);
  transform: translateY(-1px);
}

.btn-emerald {
  background: var(--emerald);
  color: #fff;
}

.btn-emerald:hover {
  background: var(--emerald-lt);
  transform: translateY(-2px);
}

.btn-white {
  background: #fff;
  color: var(--saffron);
}

.btn-white:hover {
  background: rgba(255,255,255,0.9);
  transform: translateY(-2px);
}

.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.5);
}

.btn-outline-white:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.08);
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.input {
  width: 100%;
  padding: 12px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s;
  outline: none;
}

.input:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 4px var(--saffron-pale);
}

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

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

.select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B6760' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.3s var(--ease-out);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-label {
  font-size: 12px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -1px;
}

.stat-delta {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.delta-up { color: var(--emerald); }
.delta-down { color: #DC2626; }

/* ========================================
   BADGES
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-saffron { background: var(--saffron-pale); color: var(--saffron); }
.badge-emerald { background: var(--emerald-pale); color: var(--emerald); }
.badge-sky { background: var(--sky-pale); color: var(--sky); }
.badge-violet { background: var(--violet-pale); color: var(--violet); }
.badge-amber { background: var(--amber-pale); color: var(--amber); }

/* ========================================
   SIDEBAR (Vendor)
   ======================================== */
.sidebar {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  margin: 2px 8px;
}

.sidebar-link:hover {
  background: var(--sand);
  color: var(--ink);
}

.sidebar-link.active {
  background: var(--saffron-pale);
  color: var(--saffron);
}

.sl-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

.sl-badge {
  margin-left: auto;
  background: var(--saffron);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 16px 18px 6px;
  margin-top: 8px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
.main-content {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--sand);
}

.main-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.main-body {
  padding: 24px;
  flex: 1;
}

/* ========================================
   DATA TABLE
   ======================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  background: var(--sand);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-soft);
}

.data-table tr:hover td {
  background: rgba(245,241,235,0.5);
}

/* ========================================
   ANIMATIONS & EFFECTS
   ======================================== */

/* Pulse Animation */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.pulse {
  width: 8px;
  height: 8px;
  background: var(--saffron);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* Float Animation */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.float { animation: float 3s ease-in-out infinite; }

/* Slide Up Animation */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-up { animation: slideUp 0.6s var(--ease-out) forwards; }

/* Slide In Left */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-in-left { animation: slideInLeft 0.5s var(--ease-out) forwards; }

/* Slide In Right */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-in-right { animation: slideInRight 0.5s var(--ease-out) forwards; }

/* Fade In */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in { animation: fadeIn 0.5s ease forwards; }

/* Scale In */
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.scale-in { animation: scaleIn 0.4s var(--ease-spring) forwards; }

/* Bounce */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.bounce { animation: bounce 0.6s var(--ease-spring); }

/* Spin */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin { animation: spin 1s linear infinite; }

/* Shimmer Effect */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.4) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Gradient Border Animation */
@keyframes gradientRotate {
  0% { --angle: 0deg; }
  100% { --angle: 360deg; }
}

.gradient-border {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-lg) + 2px);
  background: conic-gradient(from var(--angle), var(--saffron), var(--emerald), var(--sky), var(--saffron));
  animation: gradientRotate 4s linear infinite;
  z-index: -1;
}

/* Hover Lift Effect */
.hover-lift {
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

/* Glow Effect */
.glow {
  transition: box-shadow 0.3s;
}

.glow:hover {
  box-shadow: 0 0 40px rgba(255,107,0,0.3);
}

/* Magnetic Button Effect Base */
.magnetic {
  transition: transform 0.2s var(--ease-out);
}

/* Scroll Reveal Base */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger Children Animation */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-children.active > *:nth-child(1) { animation: slideUp 0.5s 0.1s var(--ease-out) forwards; }
.stagger-children.active > *:nth-child(2) { animation: slideUp 0.5s 0.2s var(--ease-out) forwards; }
.stagger-children.active > *:nth-child(3) { animation: slideUp 0.5s 0.3s var(--ease-out) forwards; }
.stagger-children.active > *:nth-child(4) { animation: slideUp 0.5s 0.4s var(--ease-out) forwards; }
.stagger-children.active > *:nth-child(5) { animation: slideUp 0.5s 0.5s var(--ease-out) forwards; }
.stagger-children.active > *:nth-child(6) { animation: slideUp 0.5s 0.6s var(--ease-out) forwards; }

/* ========================================
   LOADING SKELETON
   ======================================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--sand) 25%,
    var(--sand-dark) 50%,
    var(--sand) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ========================================
   TOOLTIP
   ======================================== */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 6px 12px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  pointer-events: none;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--sand);
}

::-webkit-scrollbar-thumb {
  background: var(--border-md);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ink-muted);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 60px 4vw; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .section { padding: 40px 4vw; }
  .topnav { padding: 0 4vw; }
}

/* ========================================
   PAGE TRANSITION
   ======================================== */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--saffron);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.5s var(--ease-out);
}

.page-transition.active {
  transform: translateY(0);
}

.page-transition.exit {
  transform: translateY(-100%);
}
