/**
 * MindScaler Styles - Design System basé sur mindscaler-ux
 * Palette de couleurs médicale sobre et moderne
 */

:root {
  /* Couleurs principales (HSL pour cohérence avec mindscaler-ux) */
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --primary: 142 71% 45%; /* Vert médical */
  --primary-foreground: 0 0% 100%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 142 71% 45%;
  --radius: 0.5rem;
  
  /* Couleurs HSL converties en RGB pour compatibilité */
  --color-background: hsl(var(--background));
  --color-foreground: hsl(var(--foreground));
  --color-primary: hsl(var(--primary));
  --color-primary-foreground: hsl(var(--primary-foreground));
  --color-secondary: hsl(var(--secondary));
  --color-muted: hsl(var(--muted));
  --color-border: hsl(var(--border));
}

/* Reset et base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--color-background);
  color: var(--color-foreground);
  line-height: 1.6;
  font-feature-settings: "rlig" 1, "calt" 1;
  min-height: 100vh;
}

/* Gradient de fond subtil (comme mindscaler-ux) */
.ms-gradient-bg {
  background: linear-gradient(to bottom, var(--color-background) 0%, hsl(var(--muted) / 0.2) 100%);
  min-height: 100vh;
}

/* Header */
.ms-header {
  border-bottom: 1px solid var(--color-border);
  background: hsl(var(--background) / 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem 0;
}

.ms-header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ms-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ms-logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.ms-nav {
  display: flex;
  gap: 1rem;
}

.ms-nav-link {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.2s;
}

.ms-nav-link:hover {
  color: var(--color-foreground);
}

/* Container principal */
.ms-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.ms-container-sm {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1rem;
}

.ms-container-lg {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Cards (style mindscaler-ux) */
.ms-card {
  background: var(--color-card);
  color: hsl(var(--card-foreground));
  border: 1px solid var(--color-border);
  border-radius: 1rem; /* rounded-2xl */
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s;
}

.ms-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.ms-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding-bottom: 1rem;
}

.ms-card-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.ms-card-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.ms-card-content {
  padding-top: 0;
}

/* Buttons */
.ms-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  text-decoration: none;
  outline: none;
  font-family: inherit;
}

.ms-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.ms-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Variantes de boutons */
.ms-btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-foreground);
}

.ms-btn-primary:hover {
  background: hsl(var(--primary) / 0.9);
}

.ms-btn-outline {
  border: 1px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-foreground);
}

.ms-btn-outline:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.ms-btn-ghost {
  background: transparent;
  color: var(--color-foreground);
}

.ms-btn-ghost:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.ms-btn-secondary {
  background: var(--color-secondary);
  color: hsl(var(--secondary-foreground));
}

.ms-btn-secondary:hover {
  background: hsl(var(--secondary) / 0.8);
}

/* Tailles de boutons */
.ms-btn-sm {
  height: 2.25rem;
  padding: 0 0.75rem;
}

.ms-btn-default {
  height: 2.5rem;
  padding: 0 1rem;
}

.ms-btn-lg {
  height: 2.75rem;
  padding: 0 2rem;
}

/* Badges */
.ms-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid transparent;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
}

.ms-badge-default {
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  border-color: transparent;
}

.ms-badge-secondary {
  background: var(--color-secondary);
  color: hsl(var(--secondary-foreground));
  border-color: transparent;
}

.ms-badge-success {
  background: #dcfce7;
  color: #166534;
  border-color: transparent;
}

.ms-badge-warning {
  background: #fef3c7;
  color: #92400e;
  border-color: transparent;
}

/* Sections */
.ms-section {
  padding: 5rem 0;
}

.ms-section-sm {
  padding: 3rem 0;
}

/* Hero section */
.ms-hero {
  text-align: center;
  padding: 5rem 1rem;
}

.ms-hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.ms-hero-subtitle {
  font-size: 1.25rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 2.5rem;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.ms-hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Grid */
.ms-grid {
  display: grid;
  gap: 1.5rem;
}

.ms-grid-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}

.ms-grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.ms-grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Utilitaires */
.ms-text-center {
  text-align: center;
}

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

.ms-bg-muted {
  background: var(--color-muted);
}

.ms-border {
  border: 1px solid var(--color-border);
}

.ms-rounded {
  border-radius: var(--radius);
}

.ms-rounded-lg {
  border-radius: calc(var(--radius) + 2px);
}

.ms-rounded-2xl {
  border-radius: 1rem;
}

.ms-shadow-sm {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Spacing */
.ms-space-y-4 > * + * {
  margin-top: 1rem;
}

.ms-space-y-6 > * + * {
  margin-top: 1.5rem;
}

/* Form elements */
.ms-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-foreground);
  font-size: 0.875rem;
  transition: all 0.2s;
}

.ms-input:focus {
  outline: none;
  border-color: var(--color-primary);
  ring: 2px;
  ring-color: var(--color-primary);
}

.ms-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Footer */
.ms-footer {
  border-top: 1px solid var(--color-border);
  background: hsl(var(--muted) / 0.3);
  padding: 3rem 0;
  margin-top: 3rem;
}

/* Responsive */
@media (min-width: 768px) {
  .md\:ms-grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .md\:ms-grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .ms-hero-title {
    font-size: 4rem;
  }
}

@media (max-width: 768px) {
  .ms-hero-title {
    font-size: 2rem;
  }
  
  .ms-hero-subtitle {
    font-size: 1.125rem;
  }
  
  .ms-grid-cols-3 {
    grid-template-columns: repeat(1, 1fr);
  }
  
  .ms-grid-cols-2 {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ms-animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Utilities spécifiques mindscaler-ux */
.ms-card-primary-highlight {
  background: hsl(var(--primary) / 0.05);
  border-color: hsl(var(--primary) / 0.2);
}

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

.ms-bg-primary-subtle {
  background: hsl(var(--primary) / 0.05);
}

/* Callout / Alert boxes */
.ms-callout {
  padding: 1rem;
  border-radius: var(--radius);
  border-left: 4px solid;
}

.ms-callout-info {
  background: hsl(var(--primary) / 0.05);
  border-color: var(--color-primary);
}

.ms-callout-success {
  background: #dcfce7;
  border-color: #166534;
}

/* Table */
.ms-table {
  width: 100%;
  border-collapse: collapse;
}

.ms-table th,
.ms-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.ms-table th {
  font-weight: 600;
}

/* Progress bar */
.ms-progress {
  width: 100%;
  height: 0.5rem;
  background: var(--color-muted);
  border-radius: 9999px;
  overflow: hidden;
}

.ms-progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: 9999px;
  transition: width 0.3s;
}

