/* ============================================
   ListeBambou Design System
   Optimisé Lighthouse 100/100
   ============================================ */

/* CSS Variables - Performance optimisée */
:root {
  /* Palette Monochrome + Sémantique */
  --color-bg: #f8fafc;           /* slate-50 */
  --color-surface: #ffffff;
  --color-text: #0f172a;         /* slate-900 */
  --color-text-muted: #64748b;   /* slate-500 */
  --color-border: #e2e8f0;       /* slate-200 */
  
  /* Rhizome Alert Colors */
  --rhizome-safe: #10b981;       /* emerald-500 */
  --rhizome-moderate: #f59e0b;   /* amber-500 */
  --rhizome-danger: #ef4444;     /* red-500 */
  
  /* Hardiness Colors */
  --hardiness-extreme: #1e3a8a;  /* blue-900 */
  --hardiness-excellent: #1d4ed8; /* blue-700 */
  --hardiness-good: #3b82f6;     /* blue-500 */
  --hardiness-fair: #93c5fd;     /* blue-300 */
  --hardiness-low: #dbeafe;      /* blue-100 */
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
}

/* Reset minimal pour performance */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   PILLS / BADGES SYSTEM
   ============================================ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Rhizome Pills */
.pill-rhizome-1 {
  background-color: #d1fae5; /* emerald-100 */
  color: #065f46;            /* emerald-800 */
}

.pill-rhizome-2 {
  background-color: #fef3c7; /* amber-100 */
  color: #92400e;            /* amber-800 */
}

.pill-rhizome-3 {
  background-color: #fee2e2; /* red-100 */
  color: #991b1b;            /* red-800 */
}

/* Hardiness Pills */
.pill-hardiness {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pill-hardiness-extreme { background: var(--hardiness-extreme); color: white; }
.pill-hardiness-excellent { background: var(--hardiness-excellent); color: white; }
.pill-hardiness-good { background: var(--hardiness-good); color: white; }
.pill-hardiness-fair { background: var(--hardiness-fair); color: #1e3a8a; }
.pill-hardiness-low { background: var(--hardiness-low); color: #1e40af; }

/* Height Pills */
.pill-height {
  background-color: #f1f5f9; /* slate-100 */
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

/* ============================================
   CARD COMPONENT (Grille dense)
   ============================================ */

.bamboo-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: var(--space-md);
  transition: 
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    border-color var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.bamboo-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: #cbd5e1; /* slate-300 */
}

.bamboo-card:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.bamboo-card__header {
  margin-bottom: var(--space-sm);
}

.bamboo-card__scientific {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  margin: 0 0 2px 0;
  font-style: italic;
}

.bamboo-card__common {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
}

.bamboo-card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

/* ============================================
   ALERT BOX (Rhizome warning)
   ============================================ */

.alert-rhizome {
  background: #fef2f2;
  border: 2px solid #fecaca;
  border-radius: 0.75rem;
  padding: var(--space-md);
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}

.alert-rhizome__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.alert-rhizome__title {
  font-weight: 700;
  color: #991b1b;
  margin: 0 0 var(--space-xs) 0;
}

.alert-rhizome__text {
  color: #b91c1c;
  font-size: 0.875rem;
  margin: 0;
}

/* ============================================
   BENTO GRID (Page détail)
   ============================================ */

.bento-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .bento-grid__wide {
    grid-column: span 2;
  }
  
  .bento-grid__full {
    grid-column: span 3;
  }
}

.bento-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: var(--space-lg);
}

.bento-box__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-xs) 0;
}

.bento-box__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  line-height: 1.2;
}

.bento-box__unit {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

/* ============================================
   EXPOSURE GAUGE
   ============================================ */

.exposure-gauge {
  display: flex;
  gap: 4px;
  margin-top: var(--space-sm);
}

.exposure-gauge__segment {
  height: 8px;
  flex: 1;
  border-radius: 4px;
  background: #e2e8f0;
  transition: background var(--transition-fast);
}

.exposure-gauge__segment--active {
  background: #fbbf24; /* amber-400 */
}

/* ============================================
   BUY BUTTONS (Ghost style)
   ============================================ */

.buy-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.btn-buy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: 
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.btn-buy:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.btn-buy:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.btn-buy__logo {
  font-size: 1.25rem;
}

/* ============================================
   FILTERS SIDEBAR
   ============================================ */

.filter-section {
  margin-bottom: var(--space-lg);
}

.filter-section__title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-sm) 0;
}

/* Filter Section Compact */
.filter-section--compact {
  margin-bottom: var(--space-md);
}

.filter-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
}

.filter-section__value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

/* Dual Range Slider */
.dual-range {
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
}

.dual-range input[type="range"] {
  position: absolute;
  width: 100%;
  height: 6px;
  appearance: none;
  background: transparent;
  pointer-events: none;
  z-index: 2;
}

.dual-range input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  cursor: pointer;
  pointer-events: auto;
  transition: transform var(--transition-fast);
}

.dual-range input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.dual-range input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  cursor: pointer;
  pointer-events: auto;
}

.dual-range__track {
  position: absolute;
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  z-index: 1;
}

.dual-range__range {
  position: absolute;
  height: 4px;
  background: #3b82f6;
  border-radius: 2px;
  z-index: 1;
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.checkbox-group--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}

.checkbox-group--compact {
  gap: 4px;
}

.checkbox-group--compact .checkbox-label {
  padding: 2px 0;
  font-size: 0.8rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  cursor: pointer;
  padding: var(--space-xs) 0;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
  cursor: pointer;
}

/* Checkbox as Pill */
.checkbox-pill {
  cursor: pointer;
}

.checkbox-pill input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-pill .pill {
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.checkbox-pill input[type="checkbox"]:not(:checked) + .pill {
  opacity: 0.4;
}

.checkbox-pill input[type="checkbox"]:focus-visible + .pill {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Toggle Button for More Filters */
.btn-toggle-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  margin: var(--space-sm) 0;
  background: transparent;
  border: 1px dashed var(--color-border);
  border-radius: 6px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-toggle-filters:hover {
  border-color: #94a3b8;
  color: var(--color-text);
  background: #f8fafc;
}

.btn-toggle-filters #toggle-icon {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}

/* Expandable Section */
.filter-section--expandable {
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reset Button Compact */
.btn-reset {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 8px 12px;
  margin-top: var(--space-sm);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-reset:hover {
  border-color: #94a3b8;
  color: var(--color-text);
  background: #f8fafc;
}

/* Search Input */
.search-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: var(--color-surface);
  transition: border-color var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input::placeholder {
  color: #94a3b8;
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-lg);
  }
}

.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 1024px) {
  .main-layout {
    grid-template-columns: 240px 1fr;
  }
}

.sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: var(--space-lg);
  height: fit-content;
  position: sticky;
  top: var(--space-md);
}

@media (max-width: 1023px) {
  .sidebar {
    position: static;
  }
}

/* ============================================
   GRID LAYOUT (Cards)
   ============================================ */

.bamboo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

/* ============================================
   HEADER
   ============================================ */

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.site-logo__icon {
  font-size: 1.5rem;
}

.site-stats {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ============================================
   BACK LINK
   ============================================ */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--color-text);
}

/* ============================================
   NO RESULTS
   ============================================ */

.no-results {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--color-text-muted);
}

.no-results__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.no-results__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 var(--space-sm) 0;
  color: var(--color-text);
}

.no-results__text {
  margin: 0;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  margin-top: var(--space-2xl);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
