/* ==========================================================================
   CSS DÉDIÉ : INDEX.PHP - Index & Hub des Exercices et Outils
   Fichier : css/index_exercices.css
   MonsieurMike.be - Le numérique, c'est fantas'TIC !
   ========================================================================== */

/* Style propre aux exercices intégrant la charte graphique MonsieurMike.be */
.filter-section {
  background: #ffffff;
  border: 1px solid rgba(74, 144, 226, 0.15);
  border-radius: var(--radius-lg, 20px);
  padding: 22px 26px;
  margin-bottom: 35px;
  box-shadow: 0 10px 30px rgba(74, 144, 226, 0.07);
}

.filter-label-title {
  font-family: var(--font-heading, 'Poppins', sans-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-color, #2c3e50);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-bar {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-bar + .filter-label-title {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed #e2e8f0;
}

.filter-btn {
  background-color: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  padding: 8px 16px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-heading, 'Poppins', sans-serif);
}

.filter-btn:hover {
  background-color: #eff6ff;
  border-color: var(--primary-color, #4A90E2);
  color: var(--primary-color, #4A90E2);
  transform: translateY(-2px);
}

/* Catégorie active (Bleu Monsieur Mike) */
.filter-cat-btn.active {
  background: linear-gradient(135deg, #4A90E2 0%, #357abd 100%);
  color: white;
  border-color: #357abd;
  box-shadow: 0 4px 14px rgba(74, 144, 226, 0.35);
}

/* Année d'étude active (Vert Menthe / Teal Monsieur Mike) */
.filter-grade-btn.active {
  background: linear-gradient(135deg, #6BCB77 0%, #48bb78 100%);
  color: white;
  border-color: #48bb78;
  box-shadow: 0 4px 14px rgba(107, 203, 119, 0.35);
}

/* Grille des cartes d'exercices */
.exercices-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin-bottom: 40px;
}

.exercice-card {
  background-color: #ffffff;
  border: 1px solid rgba(74, 144, 226, 0.12);
  border-radius: var(--radius-lg, 20px);
  width: calc(33.333% - 24px);
  min-width: 280px;
  max-width: 370px;
  padding: 24px 22px 22px;
  box-sizing: border-box;
  box-shadow: 0 10px 25px rgba(74, 144, 226, 0.06);
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.exercice-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color, #4A90E2), var(--secondary-color, #6BCB77));
  opacity: 0.8;
}

.exercice-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(74, 144, 226, 0.16);
  border-color: var(--primary-color, #4A90E2);
}

.badges-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 6px;
}

.exercice-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 11.5px;
  font-weight: 700;
  color: white;
  font-family: var(--font-heading, 'Poppins', sans-serif);
}

.badge-maths { background: #4A90E2; }
.badge-francais { background: #FF6B6B; }
.badge-eveil { background: #6BCB77; }
.badge-religion { background: #f59e0b; }

.grade-badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-family: var(--font-heading, 'Poppins', sans-serif);
}

.exercice-icon {
  font-size: 44px;
  margin-bottom: 12px;
  display: block;
  text-align: center;
  transition: transform 0.3s ease;
}

.exercice-card:hover .exercice-icon {
  transform: scale(1.15) rotate(-4deg);
}

.exercice-card h3 {
  font-family: var(--font-heading, 'Poppins', sans-serif);
  color: var(--text-color, #2c3e50);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.exercice-card p {
  font-family: var(--font-body, 'Open Sans', sans-serif);
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.55;
  text-align: center;
  margin-bottom: 20px;
  flex-grow: 1;
}

.btn-play {
  display: block;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-color, #4A90E2) 0%, #357abd 100%);
  color: white !important;
  font-family: var(--font-heading, 'Poppins', sans-serif);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: 50px;
  text-decoration: none !important;
  transition: all 0.25s ease;
  border: none;
  box-shadow: 0 4px 14px rgba(74, 144, 226, 0.3);
}

.btn-play:hover {
  background: linear-gradient(135deg, #357abd 0%, #2563eb 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

#no-results {
  text-align: center;
  padding: 50px 20px;
  font-size: 16px;
  color: #64748b;
  display: none;
  background: #f8fafc;
  border-radius: var(--radius-md, 16px);
  margin: 20px 0;
}

@media screen and (max-width: 900px) {
  .exercice-card {
    width: calc(50% - 15px);
  }
}

@media screen and (max-width: 600px) {
  .exercice-card {
    width: 100%;
  }
}
