/* ============================================
   PALETTE MODERNE — Dégradés bleu-violet
   ============================================ */

:root {
  --md-primary-fg-color: #6366f1;
  --md-primary-fg-color--light: #818cf8;
  --md-primary-fg-color--dark: #4f46e5;
  --md-accent-fg-color: #8b5cf6;
  --md-typeset-a-color: #6366f1;

  --color-seconde: #f59e0b;
  --color-premiere: #06b6d4;
  --color-terminale: #8b5cf6;
  --color-seconde-bg: rgba(245, 158, 11, 0.08);
  --color-premiere-bg: rgba(6, 182, 212, 0.08);
  --color-terminale-bg: rgba(139, 92, 246, 0.08);
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #818cf8;
  --md-primary-fg-color--light: #a5b4fc;
  --md-primary-fg-color--dark: #6366f1;
  --md-accent-fg-color: #a78bfa;
  --md-typeset-a-color: #a5b4fc;
  --color-seconde-bg: rgba(245, 158, 11, 0.12);
  --color-premiere-bg: rgba(6, 182, 212, 0.12);
  --color-terminale-bg: rgba(139, 92, 246, 0.12);
}

/* ============================================
   HEADER — Glassmorphism moderne
   ============================================ */

.md-header {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #1e293b !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
}

[data-md-color-scheme="slate"] .md-header {
  background: rgba(15, 23, 42, 0.85) !important;
  color: #f8fafc !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.3) !important;
}

.md-header__title, 
.md-header__button {
  color: inherit !important;
}

/* ============================================
   TABS DE NAVIGATION — Onglets en forme de pilules
   ============================================ */

.md-tabs {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-md-color-scheme="slate"] .md-tabs {
  background: rgba(15, 23, 42, 0.8) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.md-tabs__link {
  color: #64748b !important;
  opacity: 0.95;
  font-weight: 500;
  padding: 0.35rem 0.9rem !important;
  border-radius: 2rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0.25rem 0.15rem !important;
  display: inline-flex;
  align-items: center;
}

[data-md-color-scheme="slate"] .md-tabs__link {
  color: #94a3b8 !important;
}

.md-tabs__link--active,
.md-tabs__item--active .md-tabs__link {
  background: rgba(99, 102, 241, 0.12) !important; /* Fond violet/indigo translucide */
  color: var(--md-primary-fg-color) !important;
  font-weight: 600 !important;
  opacity: 1 !important;
}

[data-md-color-scheme="slate"] .md-tabs__link--active,
[data-md-color-scheme="slate"] .md-tabs__item--active .md-tabs__link {
  background: rgba(129, 140, 248, 0.18) !important;
  color: #a5b4fc !important;
}

.md-tabs__link:hover:not(.md-tabs__link--active) {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
  opacity: 1 !important;
}

[data-md-color-scheme="slate"] .md-tabs__link:hover:not(.md-tabs__link--active) {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f8fafc !important;
}

/* ============================================
   PAGE D'ACCUEIL — HERO (Épuré)
   ============================================ */

.hero-section {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  margin-bottom: 2rem;
}

.hero-section h1 {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--md-primary-fg-color);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.hero-section .hero-subtitle {
  font-size: 1.1rem;
  color: #6b7280;
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

[data-md-color-scheme="slate"] .hero-section .hero-subtitle {
  color: #9ca3af;
}

/* ============================================
   CARTES DE NIVEAU
   ============================================ */

.level-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.level-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  text-decoration: none;
  color: inherit;
  display: flex !important;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

[data-md-color-scheme="slate"] .level-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.level-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

[data-md-color-scheme="slate"] .level-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.level-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.level-card.seconde::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.level-card.premiere::before { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.level-card.terminale::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.level-card .card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
  text-align: center;
}

.level-card .card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.level-card.seconde .card-title { color: #d97706; }
.level-card.premiere .card-title { color: #0891b2; }
.level-card.terminale .card-title { color: #7c3aed; }

[data-md-color-scheme="slate"] .level-card.seconde .card-title { color: #fbbf24; }
[data-md-color-scheme="slate"] .level-card.premiere .card-title { color: #22d3ee; }
[data-md-color-scheme="slate"] .level-card.terminale .card-title { color: #a78bfa; }

.level-card .card-badge {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
}

.level-card.seconde .card-badge { background: var(--color-seconde-bg); color: #d97706; }
.level-card.premiere .card-badge { background: var(--color-premiere-bg); color: #0891b2; }
.level-card.terminale .card-badge { background: var(--color-terminale-bg); color: #7c3aed; }

[data-md-color-scheme="slate"] .level-card.seconde .card-badge { color: #fbbf24; }
[data-md-color-scheme="slate"] .level-card.premiere .card-badge { color: #22d3ee; }
[data-md-color-scheme="slate"] .level-card.terminale .card-badge { color: #a78bfa; }

.level-card .card-desc {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 1.2rem;
}

[data-md-color-scheme="slate"] .level-card .card-desc {
  color: #9ca3af;
}

.level-card .card-arrow {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  padding: 0.5rem 1.2rem;
  border-radius: 2rem;
  transition: all 0.25s ease;
  background: rgba(0, 0, 0, 0.03);
}

[data-md-color-scheme="slate"] .level-card .card-arrow {
  background: rgba(255, 255, 255, 0.05);
}

.level-card.seconde .card-arrow { color: #d97706; }
.level-card.premiere .card-arrow { color: #0891b2; }
.level-card.terminale .card-arrow { color: #7c3aed; }

[data-md-color-scheme="slate"] .level-card.seconde .card-arrow { color: #fbbf24; }
[data-md-color-scheme="slate"] .level-card.premiere .card-arrow { color: #22d3ee; }
[data-md-color-scheme="slate"] .level-card.terminale .card-arrow { color: #a78bfa; }

.level-card.seconde:hover .card-arrow { background: #d97706 !important; color: white !important; }
.level-card.premiere:hover .card-arrow { background: #0891b2 !important; color: white !important; }
.level-card.terminale:hover .card-arrow { background: #7c3aed !important; color: white !important; }

[data-md-color-scheme="slate"] .level-card.seconde:hover .card-arrow { background: #fbbf24 !important; color: #1e293b !important; }
[data-md-color-scheme="slate"] .level-card.premiere:hover .card-arrow { background: #22d3ee !important; color: #1e293b !important; }
[data-md-color-scheme="slate"] .level-card.terminale:hover .card-arrow { background: #a78bfa !important; color: #1e293b !important; }

/* ============================================
   FEATURES SECTION
   ============================================ */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin: 2rem 0;
}

.feature {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

[data-md-color-scheme="slate"] .feature {
  background: #1e293b;
  border-color: #334155;
}

.feature .feature-icon {
  font-size: 2rem;
  margin-bottom: 0.6rem;
}

.feature .feature-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.feature .feature-desc {
  font-size: 0.82rem;
  color: #6b7280;
  margin: 0;
}

[data-md-color-scheme="slate"] .feature .feature-desc {
  color: #9ca3af;
}

/* ============================================
   ENCADRÉ PROGRAMME OFFICIEL (B.O.)
   ============================================ */

.bo-officiel {
  border-left: 4px solid #6366f1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, rgba(139, 92, 246, 0.04) 100%);
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 0.75rem 0.75rem 0;
}

[data-md-color-scheme="slate"] .bo-officiel {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
}

.bo-officiel h4 {
  margin-top: 0;
  color: #4f46e5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-md-color-scheme="slate"] .bo-officiel h4 {
  color: #a5b4fc;
}

.bo-officiel h4::before {
  content: "📋";
  font-size: 1.2rem;
}

/* ============================================
   SOLUTIONS REPLIABLES
   ============================================ */

details.success {
  border-radius: 0.5rem !important;
}

details.success summary {
  font-weight: 600;
}

/* ============================================
   BLOCS DE CODE
   ============================================ */

.highlight pre,
.highlighttable {
  border-radius: 0.75rem !important;
}

.md-typeset code {
  border-radius: 0.3rem;
}

/* ============================================
   TABLEAUX
   ============================================ */

.md-typeset table:not([class]) {
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.md-typeset table:not([class]) th {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: white;
  font-weight: 600;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background: linear-gradient(135deg, #312e81, #3730a3);
}

/* ============================================
   ADMONITIONS — Style arrondi moderne
   ============================================ */

.md-typeset .admonition,
.md-typeset details {
  border-radius: 0.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  border-width: 0 0 0 4px;
}

/* ============================================
   BOUTON RETOUR EN HAUT
   ============================================ */

.md-top {
  border-radius: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   ANIMATIONS
   ============================================ */

.md-content {
  animation: fadeIn 0.3s ease;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
  .hero-section h1 {
    font-size: 1.8rem;
  }
  .hero-section .hero-subtitle {
    font-size: 1rem;
  }
  .level-cards {
    grid-template-columns: 1fr;
  }
}

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

.md-footer {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
}

.md-footer-meta__inner {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 0.75rem !important;
}

.md-copyright {
  width: 100% !important;
  text-align: center !important;
}

/* ============================================
   AJUSTEMENT DU LOGO DU HEADER
   ============================================ */

.md-header__button.md-logo img, 
.md-header__button.md-logo svg {
  height: 2.2rem !important;
  width: 2.2rem !important;
  transition: transform 0.2s ease;
}

.md-header__button.md-logo:hover img,
.md-header__button.md-logo:hover svg {
  transform: scale(1.05);
}

.md-header__button.md-logo {
  padding: 0.1rem !important;
  margin-top: 0.1rem !important;
  margin-bottom: 0.1rem !important;
}

/* ============================================
   SECTION TUTORIELS
   ============================================ */

:root {
  --color-tutoriels: #10b981;
  --color-tutoriels-bg: rgba(16, 185, 129, 0.08);
}

[data-md-color-scheme="slate"] {
  --color-tutoriels-bg: rgba(16, 185, 129, 0.12);
}

.tuto-intro {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
  border-left: 4px solid #10b981;
  border-radius: 0 0.75rem 0.75rem 0;
  padding: 1.2rem 1.5rem;
  margin: 1rem 0 2rem;
}

[data-md-color-scheme="slate"] .tuto-intro {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
}

.tuto-intro p {
  margin: 0.4rem 0;
  color: #374151;
  line-height: 1.6;
}

[data-md-color-scheme="slate"] .tuto-intro p {
  color: #d1d5db;
}

.tuto-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0 2.5rem;
}

.tuto-card {
  background: white;
  border-radius: 1rem;
  padding: 1.8rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  text-decoration: none !important;
  color: inherit !important;
  display: flex !important;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

[data-md-color-scheme="slate"] .tuto-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tuto-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #10b981, #34d399);
}

.tuto-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

[data-md-color-scheme="slate"] .tuto-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.tuto-card-icon {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
}

.tuto-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #059669;
  margin-bottom: 0.5rem;
}

[data-md-color-scheme="slate"] .tuto-card-title {
  color: #34d399;
}

.tuto-card-desc {
  color: #6b7280;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0 0 1rem;
  flex-grow: 1;
}

[data-md-color-scheme="slate"] .tuto-card-desc {
  color: #9ca3af;
}

.tuto-card-arrow {
  font-size: 0.85rem;
  font-weight: 600;
  color: #059669;
  padding: 0.45rem 1rem;
  border-radius: 2rem;
  background: rgba(16, 185, 129, 0.08);
  text-align: center;
  transition: all 0.25s ease;
}

[data-md-color-scheme="slate"] .tuto-card-arrow {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
}

.tuto-card:hover .tuto-card-arrow {
  background: #059669 !important;
  color: white !important;
}

[data-md-color-scheme="slate"] .tuto-card:hover .tuto-card-arrow {
  background: #34d399 !important;
  color: #1e293b !important;
}

@media (max-width: 600px) {
  .tuto-cards {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   CARROUSEL DES COLLÈGUES
   — Préfixé .md-typeset pour battre les styles
     du thème Material dans les versions récentes
   ============================================ */

.md-typeset .colleagues-section {
  margin: 3rem 0;
}

.md-typeset .colleagues-section h2 {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--md-primary-fg-color);
  margin-bottom: 1.5rem;
}

.md-typeset .colleagues-carousel {
  display: flex !important;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1.5rem;
  padding: 1rem 0.5rem 2rem 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.md-typeset .colleagues-carousel::-webkit-scrollbar {
  height: 8px;
}

.md-typeset .colleagues-carousel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}
[data-md-color-scheme="slate"] .md-typeset .colleagues-carousel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.md-typeset .colleagues-carousel::-webkit-scrollbar-thumb {
  background: var(--md-primary-fg-color--light);
  border-radius: 10px;
}

.md-typeset a.colleague-card {
  flex: 0 0 360px;
  scroll-snap-align: start;
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  text-decoration: none !important;
  color: inherit !important;
  display: flex !important;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  word-break: normal;
}

[data-md-color-scheme="slate"] .md-typeset a.colleague-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.md-typeset a.colleague-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #a855f7);
}

.md-typeset a.colleague-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

[data-md-color-scheme="slate"] .md-typeset a.colleague-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.md-typeset .colleague-icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
  display: block;
}

.md-typeset .colleague-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 0.5rem;
  white-space: nowrap;
}

[data-md-color-scheme="slate"] .md-typeset .colleague-name {
  color: #a5b4fc;
}

.md-typeset .colleague-desc {
  color: #6b7280;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0 0 1rem;
  flex-grow: 1;
}

[data-md-color-scheme="slate"] .md-typeset .colleague-desc {
  color: #9ca3af;
}

.md-typeset .colleague-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4f46e5;
  padding: 0.45rem 1rem;
  border-radius: 2rem;
  background: rgba(99, 102, 241, 0.08);
  text-align: center;
  transition: all 0.25s ease;
  margin-top: auto;
}

[data-md-color-scheme="slate"] .md-typeset .colleague-link {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.12);
}

.md-typeset a.colleague-card:hover .colleague-link {
  background: #4f46e5 !important;
  color: white !important;
}

[data-md-color-scheme="slate"] .md-typeset a.colleague-card:hover .colleague-link {
  background: #6366f1 !important;
  color: white !important;
}

@media (max-width: 600px) {
  .md-typeset a.colleague-card {
    flex: 0 0 280px;
  }
}

