/* ============================================================
   EDUCATIFS EPS — Zone Total Sport
   Dark Mode · Fredoka + Nunito · Cyan/Jaune/Orange/Vert
   Matching sae-generator design language
   ============================================================ */

:root {
  --bg: #111111;
  --bg2: #1a1a1a;
  --bg3: #0d0d0d;
  --primary: #00E5FF;
  --secondary: #FFD700;
  --accent: #FF9800;
  --green: #4CAF50;
  --text: #F0F0F0;
  --text-muted: rgba(240, 240, 240, 0.55);
  --text-faint: rgba(240, 240, 240, 0.3);
  --card-bg: rgba(20, 20, 20, 0.85);
  --card-bg-hover: rgba(30, 30, 30, 0.95);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(0, 229, 255, 0.5);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 40px rgba(0, 229, 255, 0.15);
  --shadow-glow: 0 0 30px rgba(0, 229, 255, 0.2);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: 70px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ===== CANVAS PARTICULES ===== */
#fire-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg3);
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #33EEFF;
}

/* ===== LOADING SCREEN ===== */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-flame {
  font-size: 4rem;
  animation: flamePulse 0.8s ease-in-out infinite alternate;
}

@keyframes flamePulse {
  from { transform: scale(1) rotate(-3deg); filter: brightness(1); }
  to   { transform: scale(1.15) rotate(3deg); filter: brightness(1.3); }
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(0, 229, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-muted);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

/* ===== HEADER ===== */
#main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
  background: rgba(17, 17, 17, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 2px solid rgba(0, 229, 255, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 229, 255, 0.05);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.5));
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #00E5FF, #FFD700, #FF9800, #4CAF50);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.logo-sub {
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.header-stats {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 20px;
  padding: 4px 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-pill:nth-child(1) { border-color: rgba(0, 229, 255, 0.3); }
.stat-pill:nth-child(2) { border-color: rgba(76, 175, 80, 0.3); }
.stat-pill:nth-child(3) { border-color: rgba(255, 152, 0, 0.3); }

.stat-num {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--secondary);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.header-nav {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Fredoka', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  background: rgba(0, 229, 255, 0.1);
  color: var(--primary);
  text-decoration: none;
}

.nav-link.active {
  border: 1px solid rgba(0, 229, 255, 0.3);
}

/* ===== HERO ===== */
.hero {
  min-height: 520px;
  padding-top: calc(var(--header-height) + 60px);
  padding-bottom: 80px;
  padding-left: 24px;
  padding-right: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 229, 255, 0.1) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 20% 100%, rgba(255, 215, 0, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(255, 152, 0, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  max-width: 700px;
  text-align: center;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease both;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 20px;
  padding: 6px 16px;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.5px;
  margin-bottom: 28px;
  text-transform: uppercase;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulseDot 1.5s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

.hero-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.3));
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 36px;
  font-weight: 600;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-primary {
  background: var(--secondary);
  color: #111;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.3);
  letter-spacing: 0.3px;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 50px rgba(255, 215, 0, 0.45);
  background: #ffe033;
}

.btn-arrow {
  font-size: 1.1rem;
  animation: arrowBounce 1.5s ease infinite;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(4px); }
}

.hero-visual {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-mascot {
  position: absolute;
  bottom: 20px;
  width: 140px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
  animation: float 3s ease-in-out infinite;
  opacity: 0.85;
}

.hero-mascot-left {
  left: 5%;
}

.hero-mascot-right {
  right: 5%;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

.floating-emoji {
  position: absolute;
  font-size: 2.2rem;
  opacity: 0.12;
  animation: floatAround 8s ease-in-out infinite;
  animation-delay: var(--delay);
}

.floating-emoji:nth-child(1)  { top: 15%; left: 5%; }
.floating-emoji:nth-child(2)  { top: 25%; right: 8%; }
.floating-emoji:nth-child(3)  { top: 55%; left: 3%; }
.floating-emoji:nth-child(4)  { top: 70%; right: 5%; }
.floating-emoji:nth-child(5)  { top: 40%; left: 92%; }
.floating-emoji:nth-child(6)  { top: 80%; left: 10%; }

@keyframes floatAround {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%       { transform: translateY(-15px) rotate(5deg); }
  66%       { transform: translateY(8px) rotate(-5deg); }
}

/* ===== GLOBAL SEARCH BAR ===== */
.global-search-bar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 8px;
}

.global-search-inner {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(0, 229, 255, 0.2);
  border-radius: 50px;
  padding: 0 20px;
  transition: var(--transition);
}

.global-search-inner:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1), 0 0 20px rgba(0, 229, 255, 0.1);
  background: rgba(255, 255, 255, 0.07);
}

.global-search-icon {
  font-size: 1.1rem;
  margin-right: 10px;
  opacity: 0.6;
  flex-shrink: 0;
}

.global-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 14px 0;
  min-width: 0;
}

.global-search-input::placeholder {
  color: var(--text-faint);
  font-size: 0.85rem;
}

.global-search-clear {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: var(--text-muted);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  margin-left: 8px;
}

.global-search-clear:hover {
  background: rgba(0, 229, 255, 0.2);
  color: var(--text);
}

.global-search-clear.hidden {
  display: none;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 24px 40px;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.pagination.hidden {
  display: none;
}

.pag-btn {
  min-width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.pag-btn:hover:not(.disabled):not(.active) {
  background: rgba(0, 229, 255, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

.pag-btn.active {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #111;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.pag-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pag-ellipsis {
  color: var(--text-faint);
  font-size: 0.85rem;
  padding: 0 4px;
}

.pag-info {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-left: 12px;
  white-space: nowrap;
}

/* ===== CATEGORY BADGE (search results) ===== */
.badge-category {
  background: rgba(255, 152, 0, 0.1);
  color: var(--accent);
  border: 1px solid rgba(255, 152, 0, 0.25);
  font-size: 0.72rem;
}

.edu-card-cat {
  margin-top: -4px;
}

/* ===== TAXONOMY SECTION ===== */
#taxonomy-section {
  padding-bottom: 80px;
}

.taxonomy-section-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--secondary);
  padding: 32px 24px 12px;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.taxonomy-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.3), transparent);
}

.taxonomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 8px 24px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.taxonomy-tile {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  animation: bounceIn 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Colored top border cycling through accent colors */
.taxonomy-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 1;
  transition: height 0.3s ease;
}

.taxonomy-tile:nth-child(4n+1)::before { background: var(--primary); }
.taxonomy-tile:nth-child(4n+2)::before { background: var(--secondary); }
.taxonomy-tile:nth-child(4n+3)::before { background: var(--green); }
.taxonomy-tile:nth-child(4n+4)::before { background: var(--accent); }

.taxonomy-tile:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: var(--shadow-hover);
  background: var(--card-bg-hover);
}

.taxonomy-tile:hover::before {
  height: 4px;
}

.taxonomy-tile:active {
  transform: translateY(-2px) scale(0.99);
}

.tile-emoji {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s ease;
}

.taxonomy-tile:hover .tile-emoji {
  transform: scale(1.15) rotate(5deg);
}

.tile-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.tile-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tile-count {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tile-count::before {
  content: '▸';
  font-size: 0.8em;
}

/* ===== CONTROLS BAR ===== */
.controls-bar {
  position: sticky;
  top: var(--header-height);
  z-index: 50;
  background: rgba(17, 17, 17, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 229, 255, 0.15);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  transition: var(--transition);
}

.controls-bar.hidden {
  display: none;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: var(--primary);
  border-radius: 50px;
  padding: 8px 18px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.back-btn:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--primary);
  transform: translateX(-3px);
}

.back-icon {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.back-btn:hover .back-icon {
  transform: translateX(-3px);
}

.controls-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: 'Fredoka', sans-serif;
}

.filter-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2300E5FF'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.15);
}

.filter-select option {
  background: #1a1a1a;
  color: var(--text);
}

.filter-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

.filter-count strong {
  color: var(--secondary);
  font-weight: 700;
}

/* ===== CATEGORY HEADER ===== */
.category-header {
  max-width: 1400px;
  margin: 0 auto;
  padding: 36px 24px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  animation: fadeInUp 0.4s ease both;
}

.cat-header-emoji {
  font-size: 3.5rem;
  filter: drop-shadow(0 4px 12px rgba(0, 229, 255, 0.3));
}

.cat-header-info h2 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  color: var(--text);
  line-height: 1.1;
}

.cat-header-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ===== EDUCATIF GRID ===== */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 8px 24px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.edu-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: scaleIn 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  position: relative;
  overflow: hidden;
}

/* Colored top border cycling on edu cards */
.edu-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.edu-card:nth-child(4n+1)::before { background: var(--primary); }
.edu-card:nth-child(4n+2)::before { background: var(--secondary); }
.edu-card:nth-child(4n+3)::before { background: var(--green); }
.edu-card:nth-child(4n+4)::before { background: var(--accent); }

.edu-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.03) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.edu-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: var(--shadow-hover);
}

.edu-card:hover::after {
  opacity: 1;
}

.edu-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.edu-card-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.25;
  flex: 1;
}

.edu-card-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.edu-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: auto;
}

.edu-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-duration {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.footer-competence {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
  opacity: 0.8;
}

.footer-arrow {
  font-size: 0.85rem;
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.edu-card:hover .footer-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  white-space: nowrap;
}

.badge-debutant {
  background: rgba(76, 175, 80, 0.15);
  color: var(--green);
  border: 1px solid rgba(76, 175, 80, 0.25);
}

.badge-intermediaire {
  background: rgba(255, 152, 0, 0.15);
  color: var(--accent);
  border: 1px solid rgba(255, 152, 0, 0.25);
}

.badge-avance {
  background: rgba(255, 82, 82, 0.15);
  color: #FF5252;
  border: 1px solid rgba(255, 82, 82, 0.25);
}

.badge-niveau {
  background: rgba(0, 229, 255, 0.1);
  color: var(--primary);
  border: 1px solid rgba(0, 229, 255, 0.2);
}

.tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 600;
}

/* ===== STATS BAR ===== */
.stats-bar {
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(0, 229, 255, 0.15);
  border-bottom: 1px solid rgba(0, 229, 255, 0.1);
  padding: 20px 24px;
}

.stats-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.sbar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 32px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sbar-icon {
  font-size: 1.1rem;
}

.sbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(0, 229, 255, 0.2);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-card {
  background: #1a1a1a;
  border: 2px solid rgba(0, 229, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 620px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 229, 255, 0.1);
  animation: scaleIn 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(0, 229, 255, 0.15);
  color: var(--text);
  transform: rotate(90deg);
}

.modal-header {
  margin-bottom: 24px;
}

.modal-emoji {
  font-size: 2.8rem;
  margin-bottom: 12px;
  display: block;
}

.modal-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 10px;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.modal-section {
  margin-bottom: 20px;
}

.modal-section-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0, 229, 255, 0.15);
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.modal-material {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.material-tag {
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
  color: var(--secondary);
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 20px 0;
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.meta-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.meta-item-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  margin-bottom: 4px;
  font-family: 'Fredoka', sans-serif;
}

.meta-item-value {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

/* ===== FAVORIS BUTTON ON CARDS ===== */
.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 215, 0, 0.2);
  color: var(--text-faint);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.fav-btn:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--secondary);
  color: var(--secondary);
  transform: scale(1.15);
}

.fav-btn.fav-active {
  color: var(--secondary);
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.4);
}

/* ===== FAVORIS FILTER BUTTON ===== */
.favoris-filter-btn {
  flex-shrink: 0;
  margin-left: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
  color: var(--text-muted);
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.favoris-filter-btn:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--secondary);
  color: var(--secondary);
}

.favoris-filter-btn.filter-active {
  background: rgba(255, 215, 0, 0.2);
  border-color: var(--secondary);
  color: var(--secondary);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}

/* ===== MODAL ACTION BUTTONS ===== */
.modal-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.modal-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.modal-action-btn:hover {
  background: rgba(0, 229, 255, 0.1);
  border-color: var(--primary);
  color: var(--text);
}

.modal-action-btn.modal-fav-btn.fav-active {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.4);
  color: var(--secondary);
}

/* ===== TOAST NOTIFICATION ===== */
.toast-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 26, 26, 0.95);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 229, 255, 0.3);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
}

/* ===== PRINT STYLES ===== */
@media print {
  body * {
    visibility: hidden;
  }

  .modal-overlay,
  .modal-overlay * {
    visibility: visible !important;
  }

  .modal-overlay {
    position: absolute;
    inset: 0;
    background: #fff !important;
    display: block !important;
    opacity: 1 !important;
    padding: 0;
  }

  .modal-card {
    position: relative;
    max-width: 100%;
    max-height: none;
    background: #fff !important;
    border: none !important;
    box-shadow: none !important;
    padding: 20px;
    border-radius: 0;
    animation: none !important;
    overflow: visible;
  }

  .modal-close,
  .modal-actions {
    display: none !important;
  }

  .modal-title {
    color: #111 !important;
    -webkit-text-fill-color: #111 !important;
    font-size: 1.5rem;
  }

  .modal-emoji {
    font-size: 2rem;
  }

  .modal-desc {
    color: #333 !important;
    font-size: 0.9rem;
  }

  .modal-section-label {
    color: #555 !important;
  }

  .modal-section-label::after {
    background: #ccc !important;
  }

  .badge {
    border: 1px solid #999 !important;
    background: #f0f0f0 !important;
    color: #333 !important;
    -webkit-text-fill-color: #333 !important;
  }

  .meta-item {
    background: #f5f5f5 !important;
    border: 1px solid #ddd !important;
  }

  .meta-item-label {
    color: #666 !important;
  }

  .meta-item-value {
    color: #111 !important;
    -webkit-text-fill-color: #111 !important;
  }

  .material-tag {
    background: #f0f0f0 !important;
    border: 1px solid #ccc !important;
    color: #333 !important;
  }

  .tag {
    background: #f0f0f0 !important;
    border: 1px solid #ccc !important;
    color: #555 !important;
  }

  .modal-divider {
    background: #ddd !important;
  }

  #fire-canvas,
  #loading-screen,
  .toast-notification {
    display: none !important;
  }
}

/* === BACKGROUND — GYMNASE === */
#gymBg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('gym-bg.png') center/cover no-repeat;
  opacity: 0.35;
  pointer-events: none;
}

/* ===== HIDDEN UTILITY ===== */
.hidden {
  display: none !important;
}

/* ===== PROGRESS BAR ===== */
.progress-bar-wrap {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.progress-debutant     { background: var(--green); width: 33%; }
.progress-intermediaire { background: var(--accent); width: 66%; }
.progress-avance       { background: #FF5252; width: 100%; }

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.7) translateY(20px); }
  60%  { opacity: 1; transform: scale(1.04) translateY(-4px); }
  80%  { transform: scale(0.98) translateY(2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Staggered animation delays pour les tiles */
.taxonomy-tile:nth-child(1)  { animation-delay: 0.02s; }
.taxonomy-tile:nth-child(2)  { animation-delay: 0.04s; }
.taxonomy-tile:nth-child(3)  { animation-delay: 0.06s; }
.taxonomy-tile:nth-child(4)  { animation-delay: 0.08s; }
.taxonomy-tile:nth-child(5)  { animation-delay: 0.10s; }
.taxonomy-tile:nth-child(6)  { animation-delay: 0.12s; }
.taxonomy-tile:nth-child(7)  { animation-delay: 0.14s; }
.taxonomy-tile:nth-child(8)  { animation-delay: 0.16s; }
.taxonomy-tile:nth-child(9)  { animation-delay: 0.18s; }
.taxonomy-tile:nth-child(10) { animation-delay: 0.20s; }
.taxonomy-tile:nth-child(11) { animation-delay: 0.22s; }
.taxonomy-tile:nth-child(12) { animation-delay: 0.24s; }

.edu-card:nth-child(1)  { animation-delay: 0.03s; }
.edu-card:nth-child(2)  { animation-delay: 0.06s; }
.edu-card:nth-child(3)  { animation-delay: 0.09s; }
.edu-card:nth-child(4)  { animation-delay: 0.12s; }
.edu-card:nth-child(5)  { animation-delay: 0.15s; }
.edu-card:nth-child(6)  { animation-delay: 0.18s; }
.edu-card:nth-child(7)  { animation-delay: 0.21s; }
.edu-card:nth-child(8)  { animation-delay: 0.24s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .header-inner {
    padding: 0 16px;
    gap: 12px;
  }

  .header-stats {
    display: none;
  }

  .header-nav {
    display: none;
  }

  .hero {
    padding-top: calc(var(--header-height) + 30px);
    padding-bottom: 50px;
    padding-left: 16px;
    padding-right: 16px;
    min-height: 400px;
  }

  .hero-title {
    font-size: 2.2rem;
    letter-spacing: -1px;
  }

  .hero-mascot {
    width: 90px;
    opacity: 0.6;
  }

  .taxonomy-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 8px 16px 20px;
  }

  .taxonomy-tile {
    padding: 18px 14px;
  }

  .tile-emoji {
    font-size: 2rem;
  }

  .tile-name {
    font-size: 0.88rem;
  }

  .edu-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 8px 16px 30px;
  }

  .controls-bar {
    padding: 10px 16px;
    gap: 10px;
  }

  .controls-filters {
    gap: 8px;
  }

  .filter-label {
    display: none;
  }

  .modal-card {
    padding: 24px 20px;
    border-radius: var(--radius);
  }

  .modal-meta-grid {
    grid-template-columns: 1fr;
  }

  .sbar-divider {
    display: none;
  }

  .sbar-item {
    padding: 6px 16px;
  }

  .stats-bar-inner {
    justify-content: flex-start;
  }

  .category-header {
    padding: 24px 16px 14px;
  }

  .cat-header-emoji {
    font-size: 2.5rem;
  }

  .cat-header-info h2 {
    font-size: 1.5rem;
  }

  .taxonomy-section-title {
    padding: 24px 16px 10px;
  }

  .global-search-bar {
    padding: 0 16px 8px;
  }

  .global-search-input::placeholder {
    font-size: 0.78rem;
  }

  .pagination {
    padding: 16px 16px 30px;
    gap: 4px;
  }

  .pag-btn {
    min-width: 34px;
    height: 34px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .hero-badge {
    font-size: 0.68rem;
  }

  .hero-subtitle {
    font-size: 0.88rem;
  }

  .btn-primary {
    padding: 12px 20px;
    font-size: 0.88rem;
  }

  .hero-mascot {
    width: 70px;
    opacity: 0.5;
  }
}
