:root {
  /* Brand Colors - Modern Indigo/Violet Palette */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --secondary: #64748b;
  --accent: #f59e0b;
  
  /* Neutral Palette */
  --background: #f8fafc;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #1e293b;
  --border: #e2e8f0;
  --input-bg: #ffffff;
  --muted: #94a3b8;
  --muted-foreground: #64748b;

  /* Status Colors */
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  /* Spacing & Borders */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-premium: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.05);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Responsive Typography Scale */
  --fs-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.75rem);
  --fs-sm: clamp(0.8rem, 0.75rem + 0.3vw, 0.875rem);
  --fs-base: clamp(0.9rem, 0.85rem + 0.4vw, 1rem);
  --fs-lg: clamp(1rem, 0.95rem + 0.5vw, 1.125rem);
  --fs-xl: clamp(1.1rem, 1.05rem + 0.6vw, 1.25rem);
  --fs-2xl: clamp(1.25rem, 1.15rem + 0.8vw, 1.5rem);
  --fs-3xl: clamp(1.5rem, 1.35rem + 1vw, 1.875rem);
  --fs-4xl: clamp(2rem, 1.8rem + 1.5vw, 2.5rem);
  --fs-5xl: clamp(2.5rem, 2.2rem + 2vw, 3.5rem);
}

[data-theme='dark'] {
  --background: #020617;
  --foreground: #f8fafc;
  --card: #0f172a;
  --card-foreground: #f1f5f9;
  --border: #1e293b;
  --input-bg: #1e293b;
  --muted: #64748b;
  --muted-foreground: #94a3b8;
  --primary-light: #1e1b4b;
}

/* Base Reset */
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease;
}

/* Typography */
h1 { font-size: var(--fs-4xl); margin-bottom: 1rem; }
h2 { font-size: var(--fs-3xl); margin-bottom: 0.75rem; }
h3 { font-size: var(--fs-2xl); margin-bottom: 0.5rem; }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-base); }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

/* Layout */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(var(--background), 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-btn {
  padding: 0.5rem;
  border-radius: 50%;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  padding: 0.5rem;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* Components */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-premium);
  transform: translateY(-2px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--fs-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-secondary {
  background: var(--background);
  border-color: var(--border);
  color: var(--foreground);
}

.btn-secondary:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

input, textarea, select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--foreground);
  font-size: var(--fs-sm);
  outline: none;
  transition: var(--transition);
}

input:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
  animation: fadeIn 0.5s ease forward;
}

/* Responsive Overhaul */
@media (max-width: 1024px) {
  .nav-container {
    padding: 0 1.5rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0.5rem 0;
  }

  .nav-container { 
    padding: 0.5rem 1rem; 
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
  }
  
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    order: 3;
    padding: 1.5rem 0;
    gap: 1.5rem !important;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
  }

  .nav-links.active {
    display: flex;
  }
  
  .nav-links a, .nav-links button, .nav-links form {
    width: 100%;
    display: block;
    text-align: left;
  }

  .nav-divider {
    display: none;
  }

  .user-info {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0.75rem;
  }

  .container { 
    padding: 2rem 1rem; 
  }
  
  .hero-title { 
    font-size: var(--fs-4xl) !important; 
    line-height: 1.1 !important;
  }

  .card {
    padding: 1.5rem 1rem !important;
  }

  /* Form Responsive Fixes */
  .input-group {
    margin-bottom: 1.25rem;
  }
}

/* Message Badges */
.message-badge {
  padding: 1rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
}

.message-badge.success { border-left-color: var(--success); }
.message-badge.error { border-left-color: var(--danger); }
.message-badge.warning { border-left-color: var(--warning); }

/* Animation Overrides */
[data-theme='dark'] .glass {
  background: rgba(15, 23, 42, 0.8);
}

/* Gradient Text */
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
