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

:root {
  --background: 230 15% 97%;
  --foreground: 230 25% 8%;
  --card: 0 0% 100%;
  --card-foreground: 230 25% 8%;
  --popover: 0 0% 100%;
  --popover-foreground: 230 25% 8%;
  --primary: 250 85% 60%;
  --primary-foreground: 0 0% 100%;
  --secondary: 230 15% 93%;
  --secondary-foreground: 230 25% 8%;
  --muted: 230 15% 95%;
  --muted-foreground: 230 10% 42%;
  --accent: 170 80% 42%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 230 15% 90%;
  --input: 230 15% 90%;
  --ring: 250 85% 60%;
  --radius: 0.875rem;
  --sidebar-background: 230 25% 6%;
  --sidebar-foreground: 230 10% 85%;
  --sidebar-primary: 250 85% 60%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 230 20% 14%;
  --sidebar-accent-foreground: 230 10% 85%;
  --sidebar-border: 230 20% 16%;
  --gradient-primary: linear-gradient(135deg, hsl(250 85% 60%), hsl(280 80% 65%), hsl(320 75% 60%));
  --gradient-accent: linear-gradient(135deg, hsl(170 80% 42%), hsl(190 85% 48%));
  --gradient-dark: linear-gradient(135deg, hsl(230 25% 5%), hsl(250 30% 10%));
  --gradient-hero: linear-gradient(160deg, hsl(250 85% 60% / 0.12), hsl(320 75% 60% / 0.06), transparent);
  --shadow-glow: 0 0 60px hsl(250 85% 60% / 0.2);
  --shadow-card: 0 4px 32px hsl(230 25% 8% / 0.06);
  --shadow-card-hover: 0 8px 40px hsl(250 85% 60% / 0.12);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

h1,h2,h3,h4,h5,h6 { font-family: 'Space Grotesk', sans-serif; }

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

.container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }

.text-gradient {
  background-image: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-primary { background-image: var(--gradient-primary); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 1.5rem; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.btn-primary { background-image: var(--gradient-primary); color: white; border: 0; }
.btn-primary:hover { opacity: 0.9; }
.btn-outline { border: 1px solid hsl(var(--border)); background: transparent; color: hsl(var(--foreground)); }
.btn-outline:hover { border-color: hsl(var(--primary) / 0.4); }
.btn-ghost { background: transparent; border: 0; color: hsl(var(--muted-foreground)); }
.btn-ghost:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.btn-sm { padding: 0.375rem 1rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1rem; }
.btn-icon { padding: 0.5rem; width: 2.25rem; height: 2.25rem; justify-content: center; }
.btn-destructive { background: hsl(var(--destructive)); color: white; }

/* Cards */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: var(--radius);
  transition: all 0.3s;
}
.card:hover { border-color: hsl(var(--primary) / 0.4); box-shadow: var(--shadow-card-hover); }
.card-content { padding: 1.75rem; }

/* Inputs */
.input, .textarea, .select-native {
  width: 100%; padding: 0.625rem 0.875rem; border: 1px solid hsl(var(--input));
  border-radius: var(--radius); background: hsl(var(--background));
  font-family: 'Inter', sans-serif; font-size: 0.875rem;
  color: hsl(var(--foreground)); transition: border-color 0.2s;
}
.input:focus, .textarea:focus, .select-native:focus {
  outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}
.input-lg { height: 3rem; }
.textarea { resize: vertical; min-height: 5rem; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; padding: 0.125rem 0.625rem;
  border-radius: 9999px; font-size: 0.75rem; font-weight: 500;
  border: 1px solid hsl(var(--border));
}
.badge-primary { background-image: var(--gradient-primary); color: white; border: 0; }
.badge-outline { background: transparent; }
.badge-destructive { background: hsl(var(--destructive)); color: white; border: 0; }
.badge-success { background: hsl(170 80% 42%); color: white; border: 0; }
.badge-warning { background: hsl(40 90% 50%); color: white; border: 0; }

/* Switch / Toggle */
.switch { position: relative; width: 2.75rem; height: 1.5rem; display: inline-block; }
.switch input { display: none; }
.switch-slider {
  position: absolute; inset: 0; background: hsl(var(--muted));
  border-radius: 9999px; cursor: pointer; transition: 0.3s;
}
.switch-slider::before {
  content: ''; position: absolute; width: 1.125rem; height: 1.125rem;
  left: 0.1875rem; top: 0.1875rem; background: white;
  border-radius: 50%; transition: 0.3s;
}
.switch input:checked + .switch-slider { background: hsl(var(--primary)); }
.switch input:checked + .switch-slider::before { transform: translateX(1.25rem); }
.switch input:disabled + .switch-slider { opacity: 0.5; cursor: not-allowed; }

/* Tabs */
.tabs-list {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: hsl(var(--muted)); border-radius: var(--radius);
  padding: 0.25rem; gap: 0.25rem;
}
.tab-trigger {
  padding: 0.5rem 0.75rem; font-size: 0.8125rem; font-weight: 500;
  border: 0; background: transparent; border-radius: calc(var(--radius) - 2px);
  cursor: pointer; color: hsl(var(--muted-foreground));
  font-family: 'Inter', sans-serif; transition: all 0.2s;
}
.tab-trigger.active { background: white; color: hsl(var(--foreground)); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.tab-content { display: none; padding-top: 1rem; }
.tab-content.active { display: block; }

/* Dialog/Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 100; display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: hsl(var(--card)); border-radius: var(--radius);
  max-width: 36rem; width: 95%; max-height: 90vh; overflow-y: auto;
  padding: 1.5rem; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.125rem; font-weight: 700; margin-bottom: 1rem; }

/* Table */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { text-align: left; padding: 0.75rem 1rem; font-size: 0.8125rem; font-weight: 500; color: hsl(var(--muted-foreground)); border-bottom: 1px solid hsl(var(--border)); }
td { padding: 0.75rem 1rem; font-size: 0.875rem; border-bottom: 1px solid hsl(var(--border)); }
tr:last-child td { border-bottom: none; }

/* Progress bar */
.progress { height: 0.375rem; background: hsl(var(--muted)); border-radius: 9999px; overflow: hidden; }
.progress-bar { height: 100%; background: hsl(var(--primary)); border-radius: 9999px; transition: width 0.5s; }

/* Toast */
.toast-container {
  position: fixed; bottom: 1rem; right: 1rem; z-index: 200;
}
.toast {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); padding: 1rem 1.25rem;
  box-shadow: var(--shadow-card); min-width: 280px;
  animation: slideInRight 0.3s ease-out;
}
.toast-title { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.25rem; }
.toast-desc { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Form layout helpers */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; }
.form-desc { font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin-top: 0.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* Color picker inline */
.color-field { display: flex; gap: 0.5rem; align-items: center; }
.color-swatch { width: 3rem; height: 2.5rem; border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 4px); cursor: pointer; padding: 0.125rem; }

/* Tooltip (CSS only) */
.tooltip-wrap { position: relative; display: inline-flex; }
.tooltip-wrap .tooltip-text {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%); background: hsl(var(--popover)); color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 4px);
  padding: 0.375rem 0.625rem; font-size: 0.6875rem; line-height: 1.4;
  white-space: normal; max-width: 240px; z-index: 50; box-shadow: var(--shadow-card);
}
.tooltip-wrap:hover .tooltip-text { display: block; }

/* Skeleton */
.skeleton { background: hsl(var(--muted)); border-radius: var(--radius); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Cookie consent */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; padding: 1rem 1.5rem;
}
.cookie-inner {
  max-width: 42rem; margin: 0 auto; border-radius: var(--radius);
  border: 1px solid hsl(var(--border)); background: hsl(var(--card));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1); padding: 1.25rem 1.5rem;
}

/* Utility */
.text-muted { color: hsl(var(--muted-foreground)); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-heading { font-family: 'Space Grotesk', sans-serif; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.grid { display: grid; }
.w-full { width: 100%; }
.hidden { display: none; }
.shrink-0 { flex-shrink: 0; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.pt-4 { padding-top: 1rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.rounded-lg { border-radius: 0.75rem; }
.rounded-xl { border-radius: var(--radius); }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid hsl(var(--border)); }
.border-dashed { border-style: dashed; }
.divide-y > * + * { border-top: 1px solid hsl(var(--border)); }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.min-h-screen { min-height: 100vh; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.inset-0 { inset: 0; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Responsive */
@media (max-width: 767px) {
  .md\:hidden { display: none !important; }
  .container { padding: 0 1rem; }
  .text-5xl { font-size: 2rem; }
  .text-4xl { font-size: 1.75rem; }
  .text-3xl { font-size: 1.5rem; }
}
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
}
