/**
 * HoplaCollect Design System
 * Variables globales, typographie et utilitaires pour un design professionnel
 * Inspired by ControleWeb - Modern clean white theme
 */

/* ============================================
   0. Google Font Import (Roboto) - must be first
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

/* ============================================
   1. CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  /* Primary Colors - Warm Blue (like controleweb) */
  --hc-primary-50: #eff6ff;
  --hc-primary-100: #dbeafe;
  --hc-primary-200: #bfdbfe;
  --hc-primary-300: #93c5fd;
  --hc-primary-400: #60a5fa;
  --hc-primary-500: #3b82f6;
  --hc-primary-600: #2563eb;
  --hc-primary-700: #1d4ed8;
  --hc-primary-800: #1e40af;
  --hc-primary-900: #1e3a8a;
  
  /* Shorthand aliases */
  --hc-primary: #3b82f6;
  --hc-primary-hover: #2563eb;
  --hc-primary-light: #dbeafe;
  --hc-primary-dark: #1d4ed8;
  
  /* Secondary / Accent - Emerald Green */
  --hc-accent-50: #ecfdf5;
  --hc-accent-100: #d1fae5;
  --hc-accent-200: #a7f3d0;
  --hc-accent-300: #6ee7b7;
  --hc-accent-400: #34d399;
  --hc-accent-500: #10b981;
  --hc-accent-600: #059669;
  --hc-accent-700: #047857;
  --hc-accent-800: #065f46;
  --hc-accent-900: #064e3b;
  
  --hc-accent: #10b981;
  --hc-accent-hover: #059669;
  --hc-accent-light: #d1fae5;
  
  /* Neutral Colors - Warm Gray (like controleweb stone palette) */
  --hc-white: #ffffff;
  --hc-gray-50: #fafaf9;
  --hc-gray-100: #f5f5f4;
  --hc-gray-200: #e7e5e4;
  --hc-gray-300: #d6d3d1;
  --hc-gray-400: #a8a29e;
  --hc-gray-500: #78716c;
  --hc-gray-600: #57534e;
  --hc-gray-700: #44403c;
  --hc-gray-800: #292524;
  --hc-gray-900: #1c1917;
  
  /* Semantic Colors */
  --hc-success: #22c55e;
  --hc-success-bg: #f0fdf4;
  --hc-success-border: #bbf7d0;
  --hc-warning: #f59e0b;
  --hc-warning-bg: #fffbeb;
  --hc-warning-border: #fde68a;
  --hc-error: #ef4444;
  --hc-error-bg: #fef2f2;
  --hc-error-border: #fecaca;
  --hc-info: #3b82f6;
  --hc-info-bg: #eff6ff;
  --hc-info-border: #bfdbfe;
  
  /* Background & Foreground */
  --hc-background: var(--hc-gray-50);
  --hc-foreground: var(--hc-gray-900);
  --hc-surface: var(--hc-white);
  --hc-border: var(--hc-gray-200);
  --hc-text: var(--hc-gray-800);
  --hc-muted: var(--hc-gray-500);
  
  /* Typography */
  --hc-font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --hc-font-display: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Font Sizes */
  --hc-text-xs: 0.75rem;
  --hc-text-sm: 0.875rem;
  --hc-text-base: 1rem;
  --hc-text-lg: 1.125rem;
  --hc-text-xl: 1.25rem;
  --hc-text-2xl: 1.5rem;
  --hc-text-3xl: 1.875rem;
  --hc-text-4xl: 2.25rem;
  --hc-text-5xl: 3rem;
  
  /* Font Weights */
  --hc-font-normal: 400;
  --hc-font-medium: 500;
  --hc-font-semibold: 600;
  --hc-font-bold: 700;
  --hc-font-extrabold: 800;
  
  /* Line Heights */
  --hc-leading-tight: 1.25;
  --hc-leading-snug: 1.375;
  --hc-leading-normal: 1.5;
  --hc-leading-relaxed: 1.625;
  
  /* Spacing Scale */
  --hc-space-1: 0.25rem;
  --hc-space-2: 0.5rem;
  --hc-space-3: 0.75rem;
  --hc-space-4: 1rem;
  --hc-space-5: 1.25rem;
  --hc-space-6: 1.5rem;
  --hc-space-8: 2rem;
  --hc-space-10: 2.5rem;
  --hc-space-12: 3rem;
  --hc-space-16: 4rem;
  
  /* Border Radius - More generous like controleweb */
  --hc-radius-sm: 0.375rem;  /* 6px */
  --hc-radius: 0.5rem;       /* 8px */
  --hc-radius-md: 0.75rem;   /* 12px */
  --hc-radius-lg: 1rem;      /* 16px */
  --hc-radius-xl: 1.5rem;    /* 24px - rounded-xl */
  --hc-radius-2xl: 2rem;     /* 32px */
  --hc-radius-full: 9999px;
  
  /* Shadows - Softer, more modern */
  --hc-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --hc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --hc-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --hc-shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --hc-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --hc-shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  
  /* Primary color shadows for buttons */
  --hc-shadow-primary: 0 4px 14px 0 rgb(59 130 246 / 0.35);
  --hc-shadow-primary-lg: 0 8px 25px 0 rgb(59 130 246 / 0.4);
  
  /* Transitions */
  --hc-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --hc-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --hc-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-index */
  --hc-z-dropdown: 100;
  --hc-z-sticky: 200;
  --hc-z-modal: 1000;
  --hc-z-tooltip: 1100;
}

/* ============================================
   2. Base Campaign Container + Theme Isolation
   ============================================ */
.hc-campaign {
  font-family: var(--hc-font-sans);
  color: var(--hc-gray-800);
  line-height: var(--hc-leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hc-campaign *,
.hc-campaign *::before,
.hc-campaign *::after {
  box-sizing: border-box;
}

/* ============================================
   3.1 Theme Isolation Reset
   Reset all elements to prevent theme interference
   ============================================ */
.hc-campaign button,
.hc-campaign input,
.hc-campaign select,
.hc-campaign textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.hc-campaign button {
  cursor: pointer;
  background: var(--hc-primary, #2563eb);
  color: var(--hc-white, #ffffff);
  padding: var(--hc-space-3, 0.75rem) var(--hc-space-5, 1.25rem);
  border-radius: var(--hc-radius-md, 0.75rem);
  font-weight: var(--hc-font-semibold, 600);
  transition: all var(--hc-transition-fast, 150ms);
}

.hc-campaign button:hover {
  background: var(--hc-primary-hover, #1d4ed8);
}

.hc-campaign button:disabled {
  background: var(--hc-gray-300, #cbd5e1);
  cursor: not-allowed;
}

.hc-campaign input[type="text"],
.hc-campaign input[type="email"],
.hc-campaign input[type="number"],
.hc-campaign input[type="password"],
.hc-campaign input[type="search"],
.hc-campaign input[type="tel"],
.hc-campaign input[type="url"],
.hc-campaign textarea {
  display: block;
  width: 100%;
  padding: var(--hc-space-3, 0.75rem) var(--hc-space-4, 1rem);
  border: 2px solid var(--hc-gray-200, #e2e8f0);
  border-radius: var(--hc-radius-md, 0.75rem);
  background: var(--hc-white, #ffffff);
  font-size: var(--hc-text-base, 1rem);
  transition: all var(--hc-transition-fast, 150ms);
}

.hc-campaign input[type="text"]:focus,
.hc-campaign input[type="email"]:focus,
.hc-campaign input[type="number"]:focus,
.hc-campaign input[type="password"]:focus,
.hc-campaign input[type="search"]:focus,
.hc-campaign input[type="tel"]:focus,
.hc-campaign input[type="url"]:focus,
.hc-campaign textarea:focus {
  outline: none;
  border-color: var(--hc-primary, #2563eb);
  box-shadow: 0 0 0 3px var(--hc-primary-light, #dbeafe);
}

.hc-campaign select {
  display: block;
  width: 100%;
  padding: var(--hc-space-3, 0.75rem) var(--hc-space-4, 1rem);
  padding-right: var(--hc-space-10, 2.5rem);
  border: 2px solid var(--hc-gray-200, #e2e8f0);
  border-radius: var(--hc-radius-md, 0.75rem);
  background: var(--hc-white, #ffffff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
  font-size: var(--hc-text-base, 1rem);
  cursor: pointer;
  transition: all var(--hc-transition-fast, 150ms);
}

.hc-campaign select:focus {
  outline: none;
  border-color: var(--hc-primary, #2563eb);
  box-shadow: 0 0 0 3px var(--hc-primary-light, #dbeafe);
}

.hc-campaign a {
  color: var(--hc-primary, #2563eb);
  text-decoration: none;
  transition: color var(--hc-transition-fast, 150ms);
}

.hc-campaign a:hover {
  color: var(--hc-primary-hover, #1d4ed8);
  text-decoration: underline;
}

.hc-campaign h1,
.hc-campaign h2,
.hc-campaign h3,
.hc-campaign h4,
.hc-campaign h5,
.hc-campaign h6 {
  font-family: var(--hc-font-display);
  font-weight: var(--hc-font-bold, 700);
  line-height: var(--hc-leading-tight, 1.25);
  color: var(--hc-gray-900, #0f172a);
  margin: 0 0 var(--hc-space-4, 1rem);
}

.hc-campaign p {
  margin: 0 0 var(--hc-space-4, 1rem);
}

.hc-campaign ul,
.hc-campaign ol {
  margin: 0 0 var(--hc-space-4, 1rem);
  padding-left: var(--hc-space-6, 1.5rem);
}

.hc-campaign li {
  margin: 0 0 var(--hc-space-2, 0.5rem);
}

.hc-campaign img {
  max-width: 100%;
  height: auto;
  display: block;
  border: none;
}

.hc-campaign table {
  width: 100%;
  border-collapse: collapse;
}

.hc-campaign th,
.hc-campaign td {
  padding: var(--hc-space-3, 0.75rem);
  text-align: left;
  border-bottom: 1px solid var(--hc-gray-200, #e2e8f0);
}

/* ============================================
   4. Utility Classes
   ============================================ */

/* Text utilities */
.hc-text-primary { color: var(--hc-primary); }
.hc-text-muted { color: var(--hc-gray-500); }
.hc-text-success { color: var(--hc-success); }
.hc-text-warning { color: var(--hc-warning); }
.hc-text-error { color: var(--hc-error); }

/* Background utilities */
.hc-bg-primary { background-color: var(--hc-primary); }
.hc-bg-primary-light { background-color: var(--hc-primary-light); }
.hc-bg-gray-50 { background-color: var(--hc-gray-50); }
.hc-bg-white { background-color: var(--hc-white); }

/* Gradient backgrounds */
.hc-gradient-primary {
  background: linear-gradient(135deg, var(--hc-primary) 0%, var(--hc-primary-dark) 100%);
}

.hc-gradient-success {
  background: linear-gradient(135deg, var(--hc-accent) 0%, #047857 100%);
}

/* Focus ring utility */
.hc-focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--hc-primary-light);
}

/* Card base - Modern glassmorphism style */
.hc-card {
  background: var(--hc-white);
  border: 1px solid var(--hc-gray-100);
  border-radius: var(--hc-radius-xl);
  box-shadow: var(--hc-shadow-sm);
  transition: all var(--hc-transition);
}

.hc-card:hover {
  box-shadow: var(--hc-shadow-lg);
  transform: translateY(-4px);
  border-color: var(--hc-primary-100);
}

/* Badge base */
.hc-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--hc-space-1) var(--hc-space-3);
  font-size: var(--hc-text-xs);
  font-weight: var(--hc-font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--hc-radius-full);
}

.hc-badge-primary {
  background: var(--hc-primary-light);
  color: var(--hc-primary-dark);
}

.hc-badge-success {
  background: var(--hc-success-bg);
  color: var(--hc-success);
}

/* Button base - Modern controleweb style */
.hc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hc-space-2);
  padding: var(--hc-space-3) var(--hc-space-6);
  font-family: var(--hc-font-sans);
  font-size: var(--hc-text-base);
  font-weight: var(--hc-font-semibold);
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--hc-radius-xl);
  cursor: pointer;
  transition: all var(--hc-transition);
}

.hc-btn-primary {
  background: var(--hc-primary-600);
  color: var(--hc-white);
  box-shadow: var(--hc-shadow-primary);
}

.hc-btn-primary:hover {
  background: var(--hc-primary-700);
  transform: translateY(-2px);
  box-shadow: var(--hc-shadow-primary-lg);
}

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

.hc-btn-secondary {
  background: var(--hc-gray-100);
  color: var(--hc-gray-800);
  border: none;
}

.hc-btn-secondary:hover {
  background: var(--hc-gray-200);
}

.hc-btn-outline {
  background: transparent;
  color: var(--hc-gray-700);
  border: 1px solid var(--hc-gray-200);
}

.hc-btn-outline:hover {
  border-color: var(--hc-gray-300);
  background: var(--hc-gray-50);
}

.hc-btn-ghost {
  background: transparent;
  color: var(--hc-gray-600);
}

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

/* Section title */
.hc-section-title {
  font-size: var(--hc-text-2xl);
  font-weight: var(--hc-font-bold);
  color: var(--hc-gray-900);
  margin: 0 0 var(--hc-space-6);
  position: relative;
  padding-bottom: var(--hc-space-3);
}

.hc-section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--hc-primary), var(--hc-accent));
  border-radius: var(--hc-radius-full);
}

/* ============================================
   5. Animation Keyframes
   ============================================ */
@keyframes hc-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hc-slide-up {
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes hc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes hc-progress-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Animation utilities */
.hc-animate-fade-in {
  animation: hc-fade-in var(--hc-transition-slow) ease-out;
}

.hc-animate-slide-up {
  animation: hc-slide-up var(--hc-transition-slow) ease-out;
}
