/* ========================================
   SUPER-COMPTABLE - ACCUEIL.CSS v8.1 OPTIMISÉ
   ✅ Cartes BLANCHES avec bordures colorées
   ✅ Sans redondances
   ✅ Responsive mobile
   ======================================== */

/* Variables couleurs */
:root {
  --brand-primary: #667eea;
  --brand-secondary: #764ba2;
  --success: #10b981;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
}

/* ========================================
   CONTENEUR PRINCIPAL
   ======================================== */
.accueil-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.accueil-container h1 {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 3rem;
}

/* ========================================
   GRILLES
   ======================================== */
.niveaux-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.matieres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.blocs-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

/* ========================================
   NIVEAU CARDS - BLANCHES AVEC BORDURE COLORÉE
   ======================================== */
.niveau-card {
  background: white;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border-left: 5px solid var(--niveau-couleur, var(--brand-primary));
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.niveau-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.niveau-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.niveau-card h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
}

.niveau-card p {
  color: var(--gray-600);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.niveau-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.niveau-stats span {
  background: var(--gray-50);
  color: var(--gray-800);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--gray-200);
}

/* ========================================
   MATIÈRE CARDS
   ======================================== */
.matiere-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  border: 2px solid transparent;
}

.matiere-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  border-color: var(--brand-primary);
}

.matiere-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.matiere-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
}

.matiere-card p {
  color: var(--gray-600);
  font-size: 0.95rem;
}

/* ========================================
   BLOC CARDS
   ======================================== */
.bloc-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--brand-primary);
}

.bloc-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
}

.bloc-card > p {
  color: var(--gray-600);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

/* ========================================
   THEMES LIST
   ======================================== */
.themes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.theme-item {
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.theme-item:hover {
  background: white;
  border-color: var(--brand-primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transform: translateX(5px);
}

.theme-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.theme-info {
  flex: 1;
  min-width: 0;
}

.theme-info h4 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
}

.theme-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.theme-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ========================================
   TABLEAUX
   ======================================== */
table thead,
table thead th {
  background: #2c3e50 !important;
  color: #ffffff !important;
  font-weight: 600;
  padding: 12px;
  border: none;
}

table tbody tr:nth-child(even) {
  background: #f8f9fa;
}

table tbody tr:hover {
  background: #e9ecef;
}

table td,
table th {
  padding: 10px 12px;
  border: 1px solid #dee2e6;
}

table tfoot {
  background: #e9ecef !important;
  font-weight: 700;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .accueil-container {
    padding: 1.5rem 1rem;
  }
  
  .accueil-container h1 {
    font-size: 2rem;
  }
  
  .niveaux-grid,
  .matieres-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .niveau-card,
  .matiere-card,
  .bloc-card {
    padding: 1.5rem;
  }
  
  .theme-item {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .niveau-icon {
    font-size: 2.5rem;
  }
  
  .niveau-card h2 {
    font-size: 1.5rem;
  }
  
  
  
}


/* ==========================================
   OPTIMISATIONS PERFORMANCE GOOGLE
   ========================================== */

/* 1. Évite les Layout Shifts (CLS) */
img, video, iframe {
    max-width: 100%;
    height: auto;
    aspect-ratio: attr(width) / attr(height); /* Réserve l'espace */
}

/* 2. Optimise le rendu des fonts */
body {
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
}

/* 3. Réduit les repaint sur les animations */
.sc-card,
.btn,
[class*="hover"] {
    will-change: transform;
    transform: translateZ(0); /* Active GPU */
}

/* 4. Masque le contenu non visible */
.lazy-section {
    content-visibility: auto;
    contain-intrinsic-size: 500px; /* Hauteur estimée */
}

/* 5. Optimise le scroll */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

#tool-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    
    /* 🚀 Optimisations supplémentaires */
    contain: layout style;  /* Isole le rendu = plus rapide */
    will-change: contents;  /* Prépare le navigateur aux changements */
}