/*
 * Ivy Wallet Inspired UI
 * Human, warm, simple design system
 * Clean and conversational aesthetics
 */

/* ============================================
   CSS Variables - Warm Palette
   ============================================ */
:root {
  /* Primary - Ivy Green */
  --ivy-50: #f0fdf4;
  --ivy-100: #dcfce7;
  --ivy-200: #bbf7d0;
  --ivy-300: #86efac;
  --ivy-400: #4ade80;
  --ivy-500: #22c55e;
  --ivy-600: #16a34a;
  --ivy-700: #15803d;
  
  /* Warm Neutrals */
  --warm-50: #fafaf9;
  --warm-100: #f5f5f4;
  --warm-200: #e7e5e4;
  --warm-300: #d6d3d1;
  --warm-400: #a8a29e;
  --warm-500: #78716c;
  --warm-600: #57534e;
  --warm-700: #44403c;
  --warm-800: #292524;
  --warm-900: #1c1917;
  
  /* Gradients */
  --gradient-ivy: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow-md: 0 4px 6px rgba(28, 25, 23, 0.07);
  --shadow-lg: 0 10px 15px rgba(28, 25, 23, 0.1);
  --shadow-glow: 0 8px 30px rgba(34, 197, 94, 0.2);
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* Dark mode */
.dark {
  --warm-50: #1c1917;
  --warm-100: #292524;
  --warm-200: #44403c;
  --warm-300: #57534e;
  --warm-400: #78716c;
  --warm-500: #a8a29e;
  --warm-600: #d6d3d1;
  --warm-700: #e7e5e4;
  --warm-800: #f5f5f4;
  --warm-900: #fafaf9;
}

/* ============================================
   Base Styles
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: var(--warm-800);
  background: var(--warm-50);
}

/* Alpine cloak */
[x-cloak] { display: none !important; }

/* Selection */
::selection {
  background: var(--ivy-400);
  color: white;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--ivy-500);
  outline-offset: 2px;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

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

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-xl);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-ivy);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(34, 197, 94, 0.3);
}

.btn-secondary {
  background: var(--ivy-50);
  color: var(--ivy-700);
  border: 2px solid var(--ivy-200);
}

.btn-secondary:hover {
  background: var(--ivy-100);
  border-color: var(--ivy-300);
}

.btn-ghost {
  background: transparent;
  color: var(--warm-600);
  padding: 8px 16px;
}

.btn-ghost:hover {
  background: var(--warm-100);
  color: var(--warm-800);
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: white;
  border-radius: var(--radius-2xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--warm-100);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.dark .card {
  background: var(--warm-800);
  border-color: var(--warm-700);
}

/* Glass card */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dark .glass {
  background: rgba(28, 25, 23, 0.8);
}

/* ============================================
   Form Inputs
   ============================================ */
.input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--warm-800);
  background: var(--warm-50);
  border: 2px solid var(--warm-200);
  border-radius: var(--radius-xl);
  transition: all var(--transition-fast);
}

.input:hover {
  border-color: var(--warm-300);
}

.input:focus {
  outline: none;
  border-color: var(--ivy-500);
  background: white;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.input::placeholder {
  color: var(--warm-400);
}

.dark .input {
  color: var(--warm-200);
  background: var(--warm-800);
  border-color: var(--warm-600);
}

/* ============================================
   Badges
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9999px;
}

.badge-green {
  background: var(--ivy-100);
  color: var(--ivy-700);
}

.badge-purple {
  background: #f3e8ff;
  color: #7e22ce;
}

.badge-orange {
  background: #fff7ed;
  color: #c2410c;
}

.dark .badge-green {
  background: rgba(34, 197, 94, 0.15);
  color: var(--ivy-400);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--warm-400);
}

.dark ::-webkit-scrollbar-thumb {
  background: var(--warm-600);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.animate-fade-up {
  animation: fade-up 0.6s ease forwards;
}

.animate-scale-in {
  animation: scale-in 0.4s ease forwards;
}

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

/* Stagger delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ============================================
   Utilities
   ============================================ */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

.glow-green {
  box-shadow: var(--shadow-glow);
}

.glow-green:hover {
  box-shadow: 0 12px 40px rgba(34, 197, 94, 0.3);
}

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

/* ============================================
   Ivy Form Inputs (Login/Auth Pages)
   ============================================ */
.ivy-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  font-family: inherit;
  color: var(--warm-800);
  background: var(--warm-50);
  border: 2px solid var(--warm-200);
  border-radius: var(--radius-xl);
  transition: all var(--transition-fast);
  line-height: 1.5;
}

.ivy-input:hover {
  border-color: var(--warm-300);
}

.ivy-input:focus {
  outline: none;
  border-color: var(--ivy-500);
  background: white;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.ivy-input::placeholder {
  color: var(--warm-400);
}

.dark .ivy-input {
  color: #e7e5e4;
  background: #292524;
  border-color: #57534e;
}

.dark .ivy-input:focus {
  background: #1c1917;
  border-color: var(--ivy-500);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

/* ============================================
   Ivy Buttons (Login/Auth Pages)
   ============================================ */
.ivy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-xl);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  line-height: 1.5;
}

.ivy-btn:hover {
  transform: translateY(-1px);
}

.ivy-btn:active {
  transform: translateY(0);
}

.ivy-btn-primary {
  background: linear-gradient(135deg, var(--ivy-500) 0%, var(--ivy-600) 100%);
  color: white;
  box-shadow: 0 8px 30px rgba(34, 197, 94, 0.2);
}

.ivy-btn-primary:hover {
  box-shadow: 0 12px 40px rgba(34, 197, 94, 0.3);
  background: linear-gradient(135deg, var(--ivy-600) 0%, var(--ivy-700) 100%);
}

.ivy-btn-primary:active {
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
}

/* ============================================
   Slide Up Animation (Auth error messages)
   ============================================ */
@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slide-up 0.3s ease-out forwards;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .card {
    padding: 20px;
    border-radius: var(--radius-xl);
  }
}

/* ============================================
   Print
   ============================================ */
@media print {
  .btn, .glass {
    box-shadow: none !important;
  }
  
  body {
    background: white !important;
  }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
