/* ============================================================
   ZEROPACT PORTAL — Design System
   Brand tokens, dark mode, typography, utilities
   ============================================================ */

@font-face {
  font-family: 'DM Sans';
  src: url('../assets/ZeroPact 2.0/Fonts/Fonts/DM Sans/DMSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'DM Sans';
  src: url('../assets/ZeroPact 2.0/Fonts/Fonts/DM Sans/DMSans-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
}
@font-face {
  font-family: 'DM Sans';
  src: url('../assets/ZeroPact 2.0/Fonts/Fonts/DM Sans/DMSans-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'DM Sans';
  src: url('../assets/ZeroPact 2.0/Fonts/Fonts/DM Sans/DMSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Zalando Sans';
  src: url('../assets/ZeroPact 2.0/Fonts/Fonts/Zalando/ZalandoSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Zalando Sans';
  src: url('../assets/ZeroPact 2.0/Fonts/Fonts/Zalando/ZalandoSansSemiExpanded-Regular.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'Zalando Sans';
  src: url('../assets/ZeroPact 2.0/Fonts/Fonts/Zalando/ZalandoSansExpanded-Regular.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

/* ---------- Light Theme (Default) ---------- */
:root {
  /* Brand Colors */
  --zp-green-50: #e5faf0;
  --zp-green-100: #c0f4df;
  --zp-green-200: #90ebc5;
  --zp-green-300: #55dfaa;
  --zp-green-400: #10a090;
  --zp-green-500: #10b080;
  --zp-green-600: #00c070;
  --zp-green-700: #00995a;
  --zp-green-800: #007343;
  --zp-green-900: #004d2d;

  /* Neutrals */
  --zp-gray-50: #f9fafb;
  --zp-gray-100: #f3f4f6;
  --zp-gray-200: #e5e7eb;
  --zp-gray-300: #d1d5db;
  --zp-gray-400: #9ca3af;
  --zp-gray-500: #6b7280;
  --zp-gray-600: #4b5563;
  --zp-gray-700: #374151;
  --zp-gray-800: #1f2937;
  --zp-gray-900: #111827;

  /* Semantic Colors */
  --color-primary: var(--zp-green-600);
  --color-primary-hover: var(--zp-green-700);
  --color-primary-light: var(--zp-green-50);
  --color-primary-soft: rgba(0, 192, 112, 0.12);

  --color-success: #00c070;
  --color-warning: #ff8010;
  --color-danger: #ef4444;
  --color-info: #3b82f6;

  /* Surfaces */
  --color-bg: #EAEAE5;
  --color-bg-alt: #E0E0DB;
  --color-surface: rgba(255, 255, 255, 0.65);
  --color-surface-solid: #ffffff;
  --color-surface-hover: rgba(255, 255, 255, 0.85);
  --color-surface-elevated: rgba(255, 255, 255, 0.8);

  /* Borders */
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-strong: rgba(0, 0, 0, 0.15);

  /* Text */
  --color-text: #1A1A2E;
  --color-text-secondary: #4b5563;
  --color-text-muted: #6b7280;
  --color-text-inverse: #ffffff;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 30px rgba(16, 185, 129, 0.15);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 999px;

  /* Typography */
  --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family-heading: 'Zalando Sans', 'DM Sans', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;

  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index */
  --z-sidebar: 100;
  --z-header: 90;
  --z-dropdown: 200;
  --z-modal: 300;
  --z-toast: 400;

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 76px;

  /* Blob decoration opacity */
  --blob-opacity: 0.25;
}

/* ---------- Dark Theme ---------- */
[data-theme="dark"] {
  --color-bg: #0f1419;
  --color-bg-alt: #151b23;
  --color-surface: rgba(30, 38, 48, 0.75);
  --color-surface-solid: #1e2630;
  --color-surface-hover: rgba(40, 50, 62, 0.85);
  --color-surface-elevated: rgba(35, 44, 56, 0.9);

  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.15);

  --color-text: #f0f4f8;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;

  --color-primary: var(--zp-green-400);
  --color-primary-hover: var(--zp-green-300);
  --color-primary-light: rgba(0, 192, 112, 0.1);
  --color-primary-soft: rgba(0, 192, 112, 0.15);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 40px rgba(0, 192, 112, 0.2);

  --blob-opacity: 0.06;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
  color: inherit;
}

input, select, textarea {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
}

ul, ol {
  list-style: none;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-md); }

.text-green {
  color: var(--color-primary);
}

.text-gradient {
  background: linear-gradient(135deg, var(--color-primary), var(--color-info));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-secondary {
  color: var(--color-text-secondary);
}

/* ---------- Utility Classes ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.grid { display: grid; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.relative { position: relative; }
.absolute { position: absolute; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Scrollbar Styling ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
}

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

/* Sidebar scrollbar hiding logic: only show on hover */
.sidebar-nav::-webkit-scrollbar-thumb {
  background: transparent;
}
.sidebar-nav:hover::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
}
.sidebar-nav:hover::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ---------- Focus Styles ---------- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Selection ---------- */
::selection {
  background: var(--color-primary-soft);
  color: var(--color-text);
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.animate-fade-in { animation: fadeIn var(--transition-base) ease both; }
.animate-fade-in-up { animation: fadeInUp var(--transition-slow) ease both; }
.animate-slide-in-left { animation: slideInLeft var(--transition-slow) ease both; }
.animate-scale-in { animation: scaleIn var(--transition-base) ease both; }
.animate-float { animation: float 3s ease-in-out infinite; }

.delay-1 { animation-delay: 50ms; }
.delay-2 { animation-delay: 100ms; }
.delay-3 { animation-delay: 150ms; }
.delay-4 { animation-delay: 200ms; }
.delay-5 { animation-delay: 250ms; }
.delay-6 { animation-delay: 300ms; }
.delay-7 { animation-delay: 350ms; }
.delay-8 { animation-delay: 400ms; }
