/**
 * WeAreRH - Styles globaux partagés (Référence)
 * Créé le: 2025-12-19
 * Modifié le: 2025-12-19
 * 
 * ATTENTION: Ce fichier est une RÉFÉRENCE uniquement.
 * L'import @import ne fonctionne pas bien avec Vite sans config spéciale.
 * 
 * UTILISATION: Copier le contenu de template.css dans chaque app/*/src/index.css
 * Cela garantit la cohérence visuelle entre toutes les applications.
 */

/* ============================================
   VARIABLES CSS - Design tokens
   ============================================ */
:root {
  /* Couleurs primaires */
  --color-primary: #122655;
  --color-primary-light: #1a3470;
  --color-primary-dark: #0c1835;
  
  /* Gradients */
  --gradient-start: #e0e7ff;
  --gradient-end: #f0f5ff;
  --gradient-body: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
  
  /* Espacements */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  
  /* Bordures */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  
  /* Ombres */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* ============================================
   BASE - Reset et typographie
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gradient-body);
  min-height: 100vh;
  color: #1f2937;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   COMPOSANTS - Styles réutilisables
   ============================================ */

/* Glass morphism card */
.glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Onglets */
.tab-active {
  background: white;
  color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-inactive {
  color: rgba(255, 255, 255, 0.8);
}

.tab-inactive:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Highlight pour résultat optimal */
.highlight-best {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border: 2px solid #22c55e;
  position: relative;
}

.highlight-best::before {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  background: #22c55e;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* ============================================
   FORMULAIRES - Inputs et focus
   ============================================ */

/* Focus states accessibles */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Input number sans spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 1000px;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease-out;
}

.animate-slideDown {
  animation: slideDown 0.3s ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   SCROLLBAR PERSONNALISÉE
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================
   IMPRESSION
   ============================================ */
@media print {
  body {
    background: white !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  
  .glass-card {
    background: white !important;
    box-shadow: none !important;
    border: 1px solid #e5e7eb !important;
  }
  
  .no-print {
    display: none !important;
  }
  
  /* Masquer boutons en impression */
  button:not(.print-show) {
    display: none !important;
  }
  
  /* Conserver les couleurs de fond */
  .bg-green-50, .bg-green-100 { background-color: #dcfce7 !important; }
  .bg-yellow-50, .bg-yellow-100 { background-color: #fef9c3 !important; }
  .bg-blue-50, .bg-blue-100 { background-color: #dbeafe !important; }
  .bg-purple-50, .bg-purple-100 { background-color: #f3e8ff !important; }
  .bg-orange-50, .bg-orange-100 { background-color: #ffedd5 !important; }
  .bg-red-50, .bg-red-100 { background-color: #fee2e2 !important; }
  .bg-amber-50, .bg-amber-100 { background-color: #fef3c7 !important; }
  
  /* Conserver les couleurs de texte */
  .text-green-600, .text-green-700, .text-green-800 { color: #16a34a !important; }
  .text-yellow-600, .text-yellow-700, .text-yellow-800 { color: #ca8a04 !important; }
  .text-blue-600, .text-blue-700, .text-blue-800 { color: #2563eb !important; }
  .text-purple-600, .text-purple-700, .text-purple-800 { color: #9333ea !important; }
  .text-orange-600, .text-orange-700, .text-orange-800 { color: #ea580c !important; }
  .text-red-600, .text-red-700, .text-red-800 { color: #dc2626 !important; }
  .text-amber-600, .text-amber-700, .text-amber-800 { color: #d97706 !important; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  html {
    font-size: 14px;
  }
}

/* ============================================
   SOURCES LÉGALES - Style uniforme
   ============================================ */
.sources-legales ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sources-legales li {
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.5rem;
}

.sources-legales li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #3b82f6;
}

.sources-legales a {
  color: #4b5563;
  text-decoration: none;
  transition: color 0.2s;
}

.sources-legales a:hover {
  color: #2563eb;
}

.sources-legales strong {
  color: #1f2937;
}

/* ============================================
   DARK MODE - Variables
   ============================================ */
:root.dark {
  /* Couleurs primaires dark */
  --color-primary: #60a5fa;
  --color-primary-light: #93c5fd;
  --color-primary-dark: #3b82f6;
  
  /* Gradients dark */
  --gradient-body: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* ============================================
   DARK MODE - Base
   ============================================ */
.dark body,
html.dark body {
  background: var(--gradient-body);
  color: #f1f5f9;
}

/* ============================================
   DARK MODE - Glass card
   ============================================ */
.dark .glass-card {
  background: rgba(30, 41, 59, 0.95);
  border-color: #334155;
  backdrop-filter: blur(10px);
}

/* ============================================
   DARK MODE - Onglets
   ============================================ */
.dark .tab-active {
  background: #1e293b;
  color: #60a5fa;
}

.dark .tab-inactive {
  color: rgba(148, 163, 184, 0.8);
}

.dark .tab-inactive:hover {
  background: rgba(51, 65, 85, 0.5);
}

/* ============================================
   DARK MODE - Highlight best
   ============================================ */
.dark .highlight-best {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
  border-color: #22c55e;
}

/* ============================================
   DARK MODE - Formulaires
   ============================================ */
.dark input,
.dark select,
.dark textarea {
  background-color: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

.dark input::placeholder,
.dark textarea::placeholder {
  color: #64748b;
}

.dark input:focus,
.dark select:focus,
.dark textarea:focus {
  border-color: #60a5fa;
  outline-color: #60a5fa;
}

/* ============================================
   DARK MODE - Scrollbar
   ============================================ */
.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}

.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ============================================
   DARK MODE - Sources légales
   ============================================ */
.dark .sources-legales li::before {
  color: #60a5fa;
}

.dark .sources-legales a {
  color: #94a3b8;
}

.dark .sources-legales a:hover {
  color: #60a5fa;
}

.dark .sources-legales strong {
  color: #f1f5f9;
}

/* ============================================
   DARK MODE - Utilitaires Tailwind override
   IMPORTANT: !important nécessaire pour surcharger Tailwind
   ============================================ */

/* Backgrounds */
.dark .bg-white { background-color: #1e293b !important; }
.dark .bg-gray-50 { background-color: #0f172a !important; }
.dark .bg-gray-100 { background-color: #1e293b !important; }
.dark .bg-gray-200 { background-color: #334155 !important; }
.dark .bg-slate-50 { background-color: #0f172a !important; }
.dark .bg-slate-100 { background-color: #1e293b !important; }

/* Textes */
.dark .text-gray-900 { color: #f1f5f9 !important; }
.dark .text-gray-800 { color: #e2e8f0 !important; }
.dark .text-gray-700 { color: #cbd5e1 !important; }
.dark .text-gray-600 { color: #94a3b8 !important; }
.dark .text-gray-500 { color: #64748b !important; }
.dark .text-gray-400 { color: #64748b !important; }
.dark .text-slate-900 { color: #f1f5f9 !important; }
.dark .text-slate-800 { color: #e2e8f0 !important; }
.dark .text-slate-700 { color: #cbd5e1 !important; }
.dark .text-slate-600 { color: #94a3b8 !important; }

/* Bordures */
.dark .border-gray-100 { border-color: #334155 !important; }
.dark .border-gray-200 { border-color: #334155 !important; }
.dark .border-gray-300 { border-color: #475569 !important; }
.dark .border-slate-200 { border-color: #334155 !important; }
.dark .border-slate-300 { border-color: #475569 !important; }

/* Dividers */
.dark .divide-gray-100 > * + * { border-color: #334155 !important; }
.dark .divide-gray-200 > * + * { border-color: #334155 !important; }

/* Shadows - réduire en dark mode */
.dark .shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3) !important; }
.dark .shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4) !important; }
.dark .shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4) !important; }
.dark .shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4) !important; }

/* Rings */
.dark .ring-gray-200 { --tw-ring-color: #334155 !important; }
.dark .ring-gray-300 { --tw-ring-color: #475569 !important; }

/* Hovers */
.dark .hover\:bg-gray-50:hover { background-color: #334155 !important; }
.dark .hover\:bg-gray-100:hover { background-color: #334155 !important; }
.dark .hover\:bg-slate-50:hover { background-color: #334155 !important; }
.dark .hover\:bg-slate-100:hover { background-color: #334155 !important; }

/* Focus rings */
.dark .focus\:ring-blue-500:focus { --tw-ring-color: rgba(96, 165, 250, 0.5) !important; }
.dark .focus\:border-blue-500:focus { border-color: #60a5fa !important; }

/* Placeholder */
.dark .placeholder-gray-400::placeholder { color: #64748b !important; }
.dark .placeholder-gray-500::placeholder { color: #64748b !important; }

/* Cards et containers spéciaux */
.dark .rounded-xl.bg-white,
.dark .rounded-lg.bg-white,
.dark .rounded-2xl.bg-white {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

/* Labels et textes de formulaire */
.dark label { color: #e2e8f0 !important; }
.dark .text-sm.font-medium { color: #e2e8f0 !important; }

/* ============================================
   TRANSITIONS - Smooth theme switching
   ============================================ */
*, *::before, *::after {
  transition-property: background-color, border-color, color, fill, stroke;
  transition-duration: 0.15s;
  transition-timing-function: ease;
}
