/* QuizThisUp - Minimalist Design System
 * Philosophy: Neutral slate palette, minimal color usage
 * Primary Color: Dark slate - neutral and professional
 * Base: Monochromatic slate grays throughout
 * Fonts: Inter (Body), Lexend Deca (Titles)
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Lexend+Deca:wght@400;500;600;700;800;900&display=swap');

/* shadcn/ui-inspired Design Tokens */
:root {
  /* Background - Slate-based neutral palette */
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  
  /* Primary - Dark slate for minimalism */
  --primary: 215 20% 20%;  /* #262f3d dark slate */
  --primary-foreground: 0 0% 100%;
  
  /* Secondary - Lighter slate for subtle variation */
  --secondary: 220 13% 28%;  /* #3a4454 medium slate */
  --secondary-foreground: 0 0% 100%;
  
  /* Muted - Subtle slate backgrounds */
  --muted: 220 14% 96%;  /* #f3f4f6 light gray */
  --muted-foreground: 220 9% 46%;  /* #6b7280 */
  
  /* Accent - Minimal use */
  --accent: 220 14% 96%;
  --accent-foreground: 222.2 47.4% 11.2%;
  
  /* Destructive - Error states */
  --destructive: 0 84% 60%;  /* #ef4444 */
  --destructive-foreground: 0 0% 100%;
  
  /* Success - Neutral slate for minimalism */
  --success: 220 13% 28%;  /* #3a4454 slate */
  --success-foreground: 0 0% 100%;
  
  /* Warning - Neutral slate for minimalism */
  --warning: 220 13% 28%;  /* #3a4454 slate */
  --warning-foreground: 0 0% 100%;
  
  /* Border - Subtle slate borders */
  --border: 220 13% 91%;  /* #e5e7eb */
  --input: 220 13% 91%;
  --ring: 215 20% 20%;  /* Dark slate for focus rings */
  
  /* Radius */
  --radius: 0.5rem;
  
  /* Legacy color variables for compatibility */
  --color-primary: #262f3d;
  --color-slate: #3a4454;
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;
  --color-slate-950: #020617;
  
  --color-success: #3a4454;
  --color-error: #ef4444;
  --color-warning: #3a4454;
  --color-text: #0a1628;
  
  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Lexend Deca', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    
    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;
    
    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;
    
    --primary: 276 31% 63%;
    --primary-foreground: 222.2 47.4% 11.2%;
    
    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;
    
    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;
    
    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;
    
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;
    
    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 276 31% 63%;
  }
}

/* Base Typography - Minimal, clean approach */
* {
  border-color: hsl(var(--border));
}

body {
  font-family: var(--font-sans);
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  font-feature-settings: "rlig" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: hsl(var(--foreground));
  font-weight: 600;
  letter-spacing: -0.025em;
}

h1 { font-size: 2.25rem; line-height: 1.2; font-weight: 700; }
h2 { font-size: 1.875rem; line-height: 1.3; font-weight: 600; }
h3 { font-size: 1.5rem; line-height: 1.4; }
h4 { font-size: 1.25rem; line-height: 1.4; }
h5 { font-size: 1.125rem; line-height: 1.5; }
h6 { font-size: 1rem; line-height: 1.5; font-weight: 600; }

/* shadcn/ui-inspired Button Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn:focus-visible {
  outline: none;
  ring: 2px;
  ring-color: hsl(var(--ring));
  ring-offset: 2px;
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* Default button - Slate predominant */
.btn-default {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.btn-default:hover {
  background-color: hsl(var(--secondary) / 0.8);
}

/* Primary button - Purple accent (use sparingly) */
.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
}

/* Destructive button */
.btn-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover {
  background-color: hsl(var(--destructive) / 0.9);
}

/* Outline button - Subtle */
.btn-outline {
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

.btn-outline:hover {
  background-color: hsl(var(--muted));
}

/* Ghost button - Minimal */
.btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
}

.btn-ghost:hover {
  background-color: hsl(var(--muted));
}

/* Link button */
.btn-link {
  background-color: transparent;
  color: hsl(var(--primary));
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn-link:hover {
  text-decoration: none;
}

/* Card Components - Slate-first */
.card {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.card-header {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
}

.card-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.card-content {
  padding: 1.5rem;
  padding-top: 0;
}

.card-footer {
  padding: 1.5rem;
  padding-top: 0;
  display: flex;
  align-items: center;
}

/* Alert Components - Minimal, functional */
.alert {
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  padding: 1rem;
  position: relative;
}

.alert-default {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

.alert-success {
  border-color: hsl(var(--success));
  color: hsl(var(--success-foreground));
  background-color: hsl(var(--success) / 0.1);
}

.alert-destructive {
  border-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  background-color: hsl(var(--destructive) / 0.1);
}

.alert-warning {
  border-color: hsl(var(--warning));
  color: hsl(var(--warning-foreground));
  background-color: hsl(var(--warning) / 0.1);
}

.alert-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
  line-height: 1;
  letter-spacing: -0.025em;
}

.alert-description {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* Badge Components - Subtle */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-default {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.badge-outline {
  background-color: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.badge-success {
  background-color: hsl(var(--success));
  color: hsl(var(--success-foreground));
}

.badge-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

/* Input Components - Clean, functional */
.input {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  transition: all 0.15s ease;
}

.input:focus {
  outline: none;
  ring: 2px;
  ring-color: hsl(var(--ring));
}

.input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.input::placeholder {
  color: hsl(var(--muted-foreground));
}

/* Link Styles - Subtle with purple accent */
a {
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: hsl(var(--primary));
}

a.link-primary {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-underline-offset: 4px;
}

a.link-primary:hover {
  text-decoration: none;
}

/* Legacy support classes */
.btn-brand-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-brand-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
}

.btn-brand-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

.btn-brand-secondary:hover {
  background-color: hsl(var(--muted));
}

.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  background-color: hsl(var(--success));
  color: hsl(var(--success-foreground));
}

.btn-success:hover {
  background-color: hsl(var(--success) / 0.9);
}

.btn-error {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.btn-error:hover {
  background-color: hsl(var(--destructive) / 0.9);
}

.card-brand {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  padding: 1.5rem;
}

/* Responsive Utilities */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  h4 { font-size: 1.25rem; }
}

/* Accessibility */
.focus-visible:focus {
  outline: 2px solid #262f3d;
  outline-offset: 2px;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg-light: #1f2937;
    --color-bg-lighter: #111827;
    --color-text-primary: #f9fafb;
    --color-text-secondary: #e5e7eb;
  }
}

/* Minimalist Override: Convert all gradient buttons to solid colors */
[class*="bg-gradient-to-r"],
[class*="bg-gradient-to-l"],
[class*="bg-gradient-to-t"],
[class*="bg-gradient-to-b"],
[class*="bg-gradient-to-br"],
[class*="bg-gradient-to-bl"],
[class*="bg-gradient-to-tr"],
[class*="bg-gradient-to-tl"] {
  background-image: none !important;
  background-color: #6c6c6c !important; /* Solid slate */
}

/* Override hover states for gradients */
[class*="hover:from-"],
[class*="hover:to-"] {
  background-image: none !important;
}

[class*="bg-gradient-to-r"]:hover,
[class*="bg-gradient-to-l"]:hover,
[class*="bg-gradient-to-t"]:hover,
[class*="bg-gradient-to-b"]:hover,
[class*="bg-gradient-to-br"]:hover,
[class*="bg-gradient-to-bl"]:hover,
[class*="bg-gradient-to-tr"]:hover,
[class*="bg-gradient-to-tl"]:hover {
  background-color: #515152 !important; /* Darker slate on hover */
}

/* Ensure text in gradients remains visible */
[class*="bg-gradient-to-r"],
[class*="bg-gradient-to-l"],
[class*="bg-gradient-to-t"],
[class*="bg-gradient-to-b"],
[class*="bg-gradient-to-br"],
[class*="bg-gradient-to-bl"],
[class*="bg-gradient-to-tr"],
[class*="bg-gradient-to-tl"] {
  color: white !important;
}
