/* ================================
   BULAWORK DESIGN SYSTEM
   Crextio-Style Premium UI
   ================================ */

/* === CSS VARIABLES === */
:root {
  /* Gradient Colors - Crextio Style */
  --gradient-white: #ffffff;
  --gradient-light-grey: #F3F4F6;
  --gradient-soft-grey: #f5f5f5;
  --gradient-light-cream: #fffef8;
  --gradient-warm-yellow: #FDE047;
  --gradient-bright-matte: #FCD34D;
  
  /* Primary Colors - Crextio Palette */
  --primary-yellow: #FCD34D;
  --primary-gold: #FDE047;
  --primary-amber: #FBBF24;
  --primary-black: #111827;
  --primary-dark: #1F2937;
  
  /* Accent Colors */
  --accent-green: #10b981;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-orange: #f97316;
  
  /* Neutral Colors */
  --neutral-black: #111827;
  --neutral-dark: #1F2937;
  --neutral-grey: #6B7280;
  --neutral-light-grey: #d1d5db;
  --neutral-soft-grey: #f3f4f6;
  --neutral-white: #ffffff;
  
  /* Status Colors (Soft Versions) - Crextio */
  --status-yellow: #FDE68A;
  --status-green: #D1FAE5;
  --status-blue: #DBEAFE;
  --status-purple: #EDE9FE;
  --status-grey: #F1F3F4;
  --status-red: #FEE2E2;
  
  /* Border Radius */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --radius-2xl: 32px;
  --radius-pill: 9999px;
  
  /* Shadows - Crextio Minimal */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 24px -8px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 12px 32px -10px rgba(0, 0, 0, 0.1);
  --shadow-glow-yellow: 0 8px 32px rgba(252, 211, 77, 0.25);
  --shadow-glow-soft: 0 4px 20px rgba(252, 211, 77, 0.18);
  
  /* Glass-morphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: blur(12px);
  
  /* Typography */
  --font-primary: 'Arial', 'Helvetica Neue', Helvetica, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Arial', 'Helvetica Neue', Helvetica, sans-serif;
  
  /* Font Sizes - Refined Scale */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 2rem;        /* 32px */
  --text-4xl: 2.5rem;      /* 40px */
  --text-5xl: 3.5rem;      /* 56px */
  --text-6xl: 4rem;        /* 64px */
  
  /* Line Heights - Improved Readability */
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;
  --leading-loose: 2;
  
  /* Letter Spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  
  /* Spacing - Refined 8px Grid System */
  --space-1: 0.5rem;     /* 8px */
  --space-2: 1rem;       /* 16px */
  --space-3: 1.5rem;     /* 24px */
  --space-4: 2rem;       /* 32px */
  --space-5: 2.5rem;     /* 40px */
  --space-6: 3rem;       /* 48px */
  --space-8: 4rem;       /* 64px */
  --space-10: 5rem;      /* 80px */
  --space-12: 6rem;      /* 96px */
  --space-16: 8rem;      /* 128px */
  --space-20: 10rem;     /* 160px */
  
  /* Container Widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 400ms ease-in-out;
}

/* === GLOBAL RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  color: var(--neutral-dark);
  background: linear-gradient(125deg, #F3F4F6 0%, #FFFFFF 40%, #FDE047 100%);
  background-attachment: fixed;
  line-height: 1.6;
  overflow-x: hidden;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--neutral-black);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}

h1 { 
  font-size: var(--text-5xl); 
  line-height: 1.1;
  letter-spacing: -0.03em;
}
h2 { 
  font-size: var(--text-4xl); 
  line-height: 1.15;
}
h3 { 
  font-size: var(--text-3xl); 
  line-height: 1.2;
}
h4 { 
  font-size: var(--text-2xl);
}
h5 { 
  font-size: var(--text-xl);
}
h6 { 
  font-size: var(--text-lg);
}

p {
  font-size: var(--text-base);
  color: var(--neutral-grey);
  line-height: var(--leading-relaxed);
  margin: 0 0 var(--space-2) 0;
}

.text-balance {
  text-wrap: balance;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

/* === UTILITY CLASSES === */

/* Gradients */
.gradient-bg {
  background: linear-gradient(135deg, var(--gradient-white) 0%, var(--gradient-light-cream) 50%, var(--gradient-warm-yellow) 100%);
}

.gradient-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 250, 232, 0.9) 100%);
}

.gradient-yellow {
  background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--primary-amber) 100%);
}

/* Glass-morphism */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

.glass-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-md);
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-premium {
  background: linear-gradient(135deg, #ffffff 0%, #fffef9 100%);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 250, 232, 0.6);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 0.875rem 2rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
  letter-spacing: var(--tracking-wide);
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 224, 102, 0.2);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--primary-amber) 100%);
  color: var(--neutral-black);
  box-shadow: var(--shadow-glow-soft);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-glow-yellow);
  transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: var(--neutral-dark);
  border: 2px solid var(--neutral-light-grey);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary-yellow);
  background: var(--gradient-light-cream);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--neutral-dark);
  border: 1px solid transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 224, 102, 0.1);
  border-color: rgba(255, 224, 102, 0.3);
}

.btn-sm {
  padding: 0.625rem 1.5rem;
  font-size: var(--text-sm);
  gap: 0.375rem;
}

.btn-lg {
  padding: 1.125rem 2.5rem;
  font-size: var(--text-lg);
  gap: 0.625rem;
}

/* Tags & Pills */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
}

.tag-yellow {
  background: var(--status-yellow);
  color: var(--primary-amber);
}

.tag-green {
  background: var(--status-green);
  color: var(--accent-green);
}

.tag-blue {
  background: var(--status-blue);
  color: var(--accent-blue);
}

.tag-purple {
  background: var(--status-purple);
  color: var(--accent-purple);
}

.tag-grey {
  background: var(--status-grey);
  color: var(--neutral-grey);
}

.tag-pink {
  background: #fce7f3;
  color: var(--accent-pink);
}

/* Avatar */
.avatar {
  border-radius: 50%;
  overflow: hidden;
  background: var(--neutral-soft-grey);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 96px; height: 96px; }
.avatar-2xl { width: 128px; height: 128px; }

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-glow {
  box-shadow: var(--shadow-glow-yellow);
  border: 3px solid white;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
}

.status-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-active {
  background: var(--status-green);
  color: var(--accent-green);
}

.status-pending {
  background: var(--status-yellow);
  color: var(--primary-amber);
}

.status-inactive {
  background: var(--status-grey);
  color: var(--neutral-grey);
}

/* Input Fields */
.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--neutral-light-grey);
  border-radius: var(--radius-lg);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  color: var(--neutral-dark);
  background: white;
  transition: var(--transition-fast);
}

.input:focus {
  outline: none;
  border-color: var(--primary-yellow);
  box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.1);
}

.input::placeholder {
  color: var(--neutral-light-grey);
}

/* Container */
.container {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-3);
  width: 100%;
}

.container-sm {
  max-width: var(--container-sm);
  margin: 0 auto;
  padding: 0 var(--space-2);
}

.container-md {
  max-width: var(--container-md);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.container-lg {
  max-width: var(--container-lg);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.container-2xl {
  max-width: var(--container-2xl);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* Section Spacing */
.section {
  padding: var(--space-12) 0;
}

.section-sm {
  padding: var(--space-8) 0;
}

.section-lg {
  padding: var(--space-16) 0;
}

/* Flex Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.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); }

/* Grid */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Spacing */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* Text Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }

/* Colors */
.text-grey { color: var(--neutral-grey); }
.text-dark { color: var(--neutral-dark); }
.text-black { color: var(--neutral-black); }

/* Border Radius */
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-pill); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-glow { box-shadow: var(--shadow-glow-yellow); }

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.6s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
  }
  
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 var(--space-4);
  }
}
