﻿/* ================================================================
   BacInfo – Unified Stylesheet (SPA) — ÉDITION FUTURISTE
   Couleurs conservées : #3cb6e6 (cyan), #1940c0 (dark blue), #2563eb (primary)
   Nouveaux motifs : hexagones, circuits, scan-lines, lignes orbitales
   Typographie : Orbitron (titres), Rajdhani (corps), Share Tech Mono (annotations)
   ================================================================ */

@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@500;600;700;800;900&family=Rajdhani:wght@400;500;600;700&family=Share+Tech+Mono&display=swap");

/* ── Reset & Root ─────────────────────────────────────────── */
:root {
  /* Palette d'origine conservée */
  --primary: #2563eb;
  --primary-dark: #1940c0;
  --cyan: #3cb6e6;

  /* Dérivés futuristes (fond sombre bleu nuit + teintes translucides) */
  --bg: #0a1230;
  --bg-panel: rgba(15, 26, 64, 0.55);
  --bg-panel-hover: rgba(20, 34, 84, 0.7);
  --glass: rgba(37, 99, 235, 0.06);
  --glass-border: rgba(60, 182, 230, 0.22);
  --glass-border-strong: rgba(60, 182, 230, 0.45);
  --white: #ffffff;

  /* Textes adaptés au fond sombre */
  --text: #e4ecff;
  --text-soft: #a3b4e0;
  --border: rgba(60, 182, 230, 0.15);

  /* Ombres lumineuses (glow au lieu d'ombre noire) */
  --shadow-sm: 0 2px 12px rgba(37, 99, 235, 0.18);
  --shadow: 0 8px 30px rgba(37, 99, 235, 0.22);
  --shadow-lg: 0 16px 50px rgba(60, 182, 230, 0.25);
  --glow-cyan: 0 0 18px rgba(60, 182, 230, 0.45);
  --glow-primary: 0 0 24px rgba(37, 99, 235, 0.5);

  --radius: 4px; /* coins plus carrés, style terminal */
  --radius-lg: 6px;
  --transition: 0.25s cubic-bezier(0.23, 1, 0.32, 1);

  /* Motifs (patterns) */
  --pat-hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%233cb6e6' stroke-opacity='0.08' stroke-width='1'/%3E%3C/svg%3E");
  --pat-circuit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cpath d='M8 8h24v12h20v8h8v16h8v12h8' fill='none' stroke='%233cb6e6' stroke-opacity='0.07' stroke-width='1'/%3E%3Ccircle cx='8' cy='8' r='3' fill='%233cb6e6' fill-opacity='0.12'/%3E%3Ccircle cx='76' cy='8' r='3' fill='%233cb6e6' fill-opacity='0.12'/%3E%3Ccircle cx='76' cy='88' r='3' fill='%233cb6e6' fill-opacity='0.12'/%3E%3Cpath d='M88 88H64v-12H44v-8h-8V52h-8V40H8' fill='none' stroke='%233cb6e6' stroke-opacity='0.07' stroke-width='1'/%3E%3C/svg%3E");
  --pat-scan: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath d='M0 0h8v1H0z' fill='%233cb6e6' fill-opacity='0.03'/%3E%3C/svg%3E");
  --pat-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='1' cy='1' r='1' fill='%233cb6e6' fill-opacity='0.12'/%3E%3C/svg%3E");
  --pat-grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M0 0h40v40H0z' fill='none' stroke='%233cb6e6' stroke-opacity='0.05' stroke-width='1'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Rajdhani", system-ui, sans-serif;
  background-color: var(--bg);
  background-image: var(--pat-circuit);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
}

/* ── SPA Section Management ───────────────────────────────── */
.spa-section {
  display: none;
}
.spa-section.active {
  display: block;
}

/* ── Typographie futuriste ────────────────────────────────── */
h1,
h2,
h3,
.logo {
  font-family: "Orbitron", sans-serif;
}

.mono,
code,
.visitor-counter,
.badge,
nav a::before {
  font-family: "Share Tech Mono", monospace;
}

/* ── Logo ─────────────────────────────────────────────────── */
.span1 {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(60, 182, 230, 0.55);
  transition: color var(--transition), text-shadow var(--transition);
  letter-spacing: 2px;
}
.span2 {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  color: var(--primary-dark);
  transition: color var(--transition), text-shadow var(--transition);
  letter-spacing: 2px;
}
.span1:hover {
  color: var(--primary-dark);
  text-shadow: 0 0 18px rgba(60, 182, 230, 0.85);
}
.span2:hover {
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(60, 182, 230, 0.55);
}

/* ── Header ───────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 18, 48, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 rgba(60, 182, 230, 0.15), 0 4px 24px rgba(0, 0, 0, 0.35);
  padding: 1rem 6%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header::after {
  /* fine ligne gradient sous le header */
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyan) 25%,
    var(--primary) 75%,
    transparent
  );
  opacity: 0.6;
}

.logo {
  font-size: 1.45rem;
  font-weight: 800;
}

/* ── Navigation ───────────────────────────────────────────── */
nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

nav a {
  position: relative;
  text-decoration: none;
  color: var(--text-soft);
  font-family: "Share Tech Mono", monospace;
  font-weight: 400;
  font-size: 13.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 2px;
  transition: color var(--transition), background var(--transition),
    box-shadow var(--transition);
}

/* Ligne d'indicateur : nœud lumineux + barre (remplace le soulignement classique) */
nav a::before {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  transform: scale(0);
  transition: transform var(--transition);
}
nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--primary));
  box-shadow: 0 0 6px rgba(60, 182, 230, 0.7);
  transform: scaleX(0);
  transition: transform var(--transition);
  transform-origin: center;
}

nav a:hover {
  color: var(--cyan);
  background: rgba(60, 182, 230, 0.08);
  box-shadow: inset 0 0 12px rgba(60, 182, 230, 0.1);
}
nav a:hover::after {
  transform: scaleX(1);
}
nav a:hover::before {
  transform: scale(1);
}

nav a.active {
  color: var(--cyan);
  font-weight: 600;
  background: rgba(60, 182, 230, 0.1);
  text-shadow: 0 0 10px rgba(60, 182, 230, 0.45);
}
nav a.active::after {
  transform: scaleX(1);
}
nav a.active::before {
  transform: scale(1);
}

/* ── Hero Section ─────────────────────────────────────────── */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5rem 6%;
  gap: 3rem;
  min-height: 80vh;
  background-image: radial-gradient(
      ellipse 60% 50% at 75% 35%,
      rgba(60, 182, 230, 0.14),
      transparent 70%
    ),
    radial-gradient(
      ellipse 50% 45% at 15% 80%,
      rgba(37, 99, 235, 0.2),
      transparent 70%
    ),
    var(--pat-hex);
  position: relative;
  overflow: hidden;
}

/* Cercles orbitaux décoratifs dans le hero */
.hero-section::before {
  content: "";
  position: absolute;
  right: -180px;
  top: 60px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(60, 182, 230, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(60, 182, 230, 0.08);
  pointer-events: none;
}
.hero-section::after {
  content: "";
  position: absolute;
  right: -90px;
  top: 150px;
  width: 340px;
  height: 340px;
  border: 1px dashed rgba(37, 99, 235, 0.35);
  border-radius: 50%;
  animation: orbit-spin 40s linear infinite;
  pointer-events: none;
}

@keyframes orbit-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.hero-content {
  max-width: 560px;
  position: relative;
  z-index: 2;
}

.hero-content h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1.2rem;
  color: var(--white);
  letter-spacing: -0.3px;
  text-shadow: 0 0 30px rgba(37, 99, 235, 0.5);
}
.hero-content h1 .accent {
  background: linear-gradient(90deg, var(--cyan), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Étiquette HUD au-dessus du titre */
.hero-content h1::before {
  content: "// SYSTÈME DE RÉVISION";
  display: block;
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--cyan);
  margin-bottom: 1rem;
  text-shadow: 0 0 10px rgba(60, 182, 230, 0.5);
}

.hero-content p {
  font-size: 1.1rem;
  color: var(--text-soft);
  line-height: 1.75;
  margin-bottom: 2rem;
}

.hero-content button {
  position: relative;
  padding: 0.85rem 2.2rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 3px;
  border: 1px solid rgba(60, 182, 230, 0.5);
  background: linear-gradient(
    135deg,
    rgba(25, 64, 192, 0.85),
    rgba(37, 99, 235, 0.9)
  );
  color: white;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35),
    inset 0 0 18px rgba(60, 182, 230, 0.15);
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
  overflow: hidden;
}
/* balayage lumineux au survol */
.hero-content button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent,
    rgba(60, 182, 230, 0.35),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.55s ease;
}
.hero-content button:hover::before {
  left: 140%;
}

.hero-content button:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow-primary), 0 10px 28px rgba(37, 99, 235, 0.45);
  border-color: var(--cyan);
}

.hero-content button a {
  text-decoration: none;
  color: white;
  font-weight: 600;
}

.hero-image {
  position: relative;
  z-index: 2;
}
.hero-image img {
  max-width: 460px;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(60, 182, 230, 0.15);
  transition: transform 0.35s ease, box-shadow var(--transition);
}
.hero-image img:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(60, 182, 230, 0.3);
}
/* cadre technique autour de l'image */
.hero-image::after {
  content: "";
  position: absolute;
  inset: -14px;
  border: 1px solid rgba(60, 182, 230, 0.2);
  border-radius: 8px;
  clip-path: polygon(
    0 18px,
    18px 0,
    calc(100% - 18px) 0,
    100% 18px,
    100% calc(100% - 18px),
    calc(100% - 18px) 100%,
    18px 100%,
    0 calc(100% - 18px)
  );
  pointer-events: none;
}
/* ── About / Cards Section ────────────────────────────────── */
.cards-section {
  padding: 4rem 6%;
  background: radial-gradient(
      ellipse 70% 60% at 20% 50%,
      rgba(37, 99, 235, 0.12),
      transparent 70%
    ),
    var(--bg);
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-card {
  background: var(--bg-panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2.5rem 3rem;
  max-width: 900px;
  width: 100%;
  border: 1px solid var(--glass-border);
  position: relative;
  transition: box-shadow var(--transition), transform var(--transition),
    border-color var(--transition);
}
/* Coins HUD en L (haut-gauche + bas-droite) — signature du motif */
.about-card::before,
.about-card::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: var(--cyan);
  border-style: solid;
  pointer-events: none;
  transition: border-color var(--transition);
}
.about-card::before {
  top: 10px;
  left: 10px;
  border-width: 2px 0 0 2px;
}
.about-card::after {
  bottom: 10px;
  right: 10px;
  border-width: 0 2px 2px 0;
}
.about-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  border-color: var(--glass-border-strong);
}
.about-card:hover::before,
.about-card:hover::after {
  border-color: rgba(60, 182, 230, 0.9);
}

.badge {
  display: inline-block;
  background: linear-gradient(
    135deg,
    rgba(60, 182, 230, 0.1),
    rgba(37, 99, 235, 0.18)
  );
  color: var(--cyan);
  border: 1px solid rgba(60, 182, 230, 0.35);
  border-radius: 2px;
  padding: 4px 14px;
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  box-shadow: 0 0 10px rgba(60, 182, 230, 0.15);
}

.about-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1.2rem;
  text-shadow: 0 0 20px rgba(37, 99, 235, 0.45);
}

.text-content p {
  color: var(--text-soft);
  margin-bottom: 1rem;
  font-size: 17.5px;
  line-height: 1.75;
}
.text-content p:last-child {
  margin-bottom: 0;
}

/* ── Matières Grid ────────────────────────────────────────── */
.matieres-section {
  padding: 3rem 6%;
  background-image: var(--pat-grid);
}

.matieres-section .titre {
  text-align: center;
  margin-bottom: 2.5rem;
}
.matieres-section .titre h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 24px rgba(37, 99, 235, 0.5);
}
.matieres-section .titre p {
  color: var(--text-soft);
  font-size: 1rem;
}
/* Ligne de données animée sous le titre */
.matieres-section .titre::after {
  content: "";
  display: block;
  margin: 1.2rem auto 0;
  width: 120px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyan),
    var(--primary),
    transparent
  );
  box-shadow: 0 0 12px rgba(60, 182, 230, 0.6);
  animation: data-flow 2.5s ease-in-out infinite;
}

@keyframes data-flow {
  0%,
  100% {
    opacity: 0.4;
    transform: scaleX(0.75);
  }
  50% {
    opacity: 1;
    transform: scaleX(1.1);
  }
}

.matieres-section .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.matieres-section .card {
  background: var(--bg-panel);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--glass-border);
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition), background var(--transition);
  cursor: pointer;
}
/* balayage de scan au survol */
.matieres-section .card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(60, 182, 230, 0.09),
    transparent 45%
  );
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.matieres-section .card:hover::before {
  opacity: 1;
}
.matieres-section .card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  border-color: var(--glass-border-strong);
  background: var(--bg-panel-hover);
}

.matieres-section .card i {
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--cyan), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  display: block;
  filter: drop-shadow(0 0 8px rgba(60, 182, 230, 0.45));
}

.matieres-section .card h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.2rem;
}

.matieres-section .card button {
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.85),
    rgba(25, 64, 192, 0.95)
  );
  color: white;
  border: 1px solid rgba(60, 182, 230, 0.4);
  border-radius: 3px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition),
    box-shadow var(--transition);
  width: 100%;
}
.matieres-section .card button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: var(--glow-primary);
}
.matieres-section .card button a {
  text-decoration: none;
  color: white;
}

/* ── Material Page (subject pages) ───────────────────────── */
.material-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.material-page h1 {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.4rem;
  text-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
}

.subtitle {
  color: var(--text-soft);
  font-size: 15px;
  margin-bottom: 2rem;
}

/* Back button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(60, 182, 230, 0.3);
  border-radius: 3px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: background var(--transition), transform var(--transition),
    box-shadow var(--transition);
}
.back-btn:hover {
  background: rgba(60, 182, 230, 0.15);
  transform: translateX(-2px);
  box-shadow: 0 0 12px rgba(60, 182, 230, 0.3);
}

.ressource-category {
  margin-top: 2rem;
}
.ressource-category > h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 1.2rem;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  position: relative;
  text-shadow: 0 0 14px rgba(60, 182, 230, 0.5);
}
.ressource-category > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--primary));
  border-radius: 1px;
  box-shadow: 0 0 10px rgba(60, 182, 230, 0.7);
}

.sub-category {
  margin-bottom: 1.75rem;
}
.sub-category h3 {
  font-family: "Share Tech Mono", monospace;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-soft);
  margin-bottom: 1rem;
  padding-left: 10px;
  border-left: 3px solid var(--cyan);
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(60, 182, 230, 0.35);
}

.ressource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.ressource-card {
  background: var(--bg-panel);
  backdrop-filter: blur(8px);
  padding: 1.2rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}
.ressource-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow), var(--glow-cyan);
  border-color: var(--glass-border-strong);
}
.ressource-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
}

.btn-pdf {
  display: block;
  width: 100%;
  padding: 8px 0;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.85),
    rgba(25, 64, 192, 0.95)
  );
  color: white;
  text-decoration: none;
  border-radius: 3px;
  border: 1px solid rgba(60, 182, 230, 0.35);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  transition: opacity var(--transition), transform var(--transition),
    box-shadow var(--transition);
}
.btn-pdf:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: var(--glow-primary);
}

.tip-card {
  background: linear-gradient(
    135deg,
    rgba(60, 182, 230, 0.08),
    rgba(37, 99, 235, 0.14)
  );
  border-left: 4px solid var(--cyan);
  border-color: rgba(60, 182, 230, 0.2);
  box-shadow: inset 0 0 20px rgba(60, 182, 230, 0.05);
}
.tip-card p {
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.65;
}

.btn-bacweb {
  display: inline-block;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  text-decoration: none;
  border-radius: 3px;
  border: 1px solid rgba(60, 182, 230, 0.4);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: opacity var(--transition), box-shadow var(--transition);
}
.btn-bacweb:hover {
  opacity: 0.85;
  box-shadow: var(--glow-primary);
}

/* ── Videos Section ───────────────────────────────────────── */
.page-hero {
  background: linear-gradient(
      135deg,
      rgba(10, 18, 48, 0.88),
      rgba(25, 64, 192, 0.55) 50%,
      rgba(60, 182, 230, 0.35) 100%
    ),
    var(--pat-dots);
  color: white;
  text-align: center;
  padding: 3rem 6%;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
}
.page-hero::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyan) 30%,
    var(--primary) 70%,
    transparent
  );
  box-shadow: 0 0 14px rgba(60, 182, 230, 0.6);
}
.page-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 24px rgba(37, 99, 235, 0.6);
}
.page-hero p {
  font-size: 1.05rem;
  opacity: 0.88;
  color: var(--text);
}

.videos-section {
  padding: 2.5rem 6%;
  background-image: var(--pat-scan);
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.video-card {
  background: var(--bg-panel);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}
.video-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  border-color: var(--glass-border-strong);
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
}
.video-wrapper iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

.video-card h3 {
  font-family: "Orbitron", sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  padding: 10px 14px 4px;
}
.video-card p {
  font-size: 13px;
  color: var(--text-soft);
  padding: 0 14px 12px;
}

/* ── Contact Section ──────────────────────────────────────── */
.avis-section {
  max-width: 700px;
  margin: 3rem auto;
  padding: 0 1.5rem 3rem;
}

.contact-info {
  background: var(--bg-panel);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
}
/* coins HUD identiques aux cartes */
.contact-info::before,
.contact-info::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: var(--cyan);
  border-style: solid;
  pointer-events: none;
}
.contact-info::before {
  top: 10px;
  left: 10px;
  border-width: 2px 0 0 2px;
}
.contact-info::after {
  bottom: 10px;
  right: 10px;
  border-width: 0 2px 2px 0;
}

.contact-info h1 {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.8rem;
  text-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
}
.contact-info p {
  color: var(--text-soft);
  margin-bottom: 1.2rem;
}
.contact-info i {
  color: var(--cyan);
  margin-right: 6px;
  text-shadow: 0 0 10px rgba(60, 182, 230, 0.6);
}

.email-btn {
  display: inline-block;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.9),
    rgba(25, 64, 192, 0.95)
  );
  color: white;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 3px;
  border: 1px solid rgba(60, 182, 230, 0.45);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35),
    inset 0 0 16px rgba(60, 182, 230, 0.12);
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}
.email-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow-primary), 0 10px 25px rgba(37, 99, 235, 0.45);
  border-color: var(--cyan);
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: rgba(8, 14, 40, 0.9);
  border-top: 1px solid var(--glass-border);
  padding: 2.5rem 6% 1.5rem;
  margin-top: 4rem;
  background-image: var(--pat-dots);
  position: relative;
}
.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyan) 30%,
    var(--primary) 70%,
    transparent
  );
}

.footer-s1 {
  max-width: 1100px;
  margin: 0 auto;
}

.footer-s1 h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
  color: var(--white);
  text-shadow: 0 0 16px rgba(37, 99, 235, 0.5);
}
.footer-s1 > p {
  color: var(--text-soft);
  font-size: 14px;
  margin-bottom: 1.5rem;
}

.footer-s1-2 {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.footer-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-links a {
  font-family: "Share Tech Mono", monospace;
  text-decoration: none;
  color: var(--text-soft);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color var(--transition), text-shadow var(--transition);
}
.footer-links a:hover {
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(60, 182, 230, 0.6);
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}
.footer-social .icon {
  width: 34px;
  height: 34px;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid var(--glass-border);
  border-radius: 3px; /* icônes carrées, style terminal */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
    box-shadow var(--transition);
}
.footer-social .icon:hover {
  background: rgba(60, 182, 230, 0.15);
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}
.footer-social svg {
  width: 16px;
  fill: var(--cyan);
}

.footer-bottom {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 13px;
  color: var(--text-soft);
  font-family: "Share Tech Mono", monospace;
}

.visitor-counter {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}
#visitor-count {
  font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(60, 182, 230, 0.55);
}

/* Simple footer (sub-pages) */
.footer-simple {
  background: rgba(8, 14, 40, 0.9);
  border-top: 1px solid var(--glass-border);
  text-align: center;
  padding: 1.5rem;
  color: var(--text-soft);
  font-size: 13px;
  margin-top: 4rem;
}

/* ── Animations d'entrée (cascade douce) ─────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .matieres-section .card,
  .ressource-card,
  .video-card {
    animation: card-rise 0.45s cubic-bezier(0.23, 1, 0.32, 1) backwards;
  }
  .matieres-section .card:nth-child(2),
  .ressource-card:nth-child(2),
  .video-card:nth-child(2) {
    animation-delay: 60ms;
  }
  .matieres-section .card:nth-child(3),
  .ressource-card:nth-child(3),
  .video-card:nth-child(3) {
    animation-delay: 120ms;
  }
  .matieres-section .card:nth-child(4),
  .ressource-card:nth-child(4),
  .video-card:nth-child(4) {
    animation-delay: 180ms;
  }
  .matieres-section .card:nth-child(5),
  .ressource-card:nth-child(5),
  .video-card:nth-child(5) {
    animation-delay: 240ms;
  }
  .matieres-section .card:nth-child(6),
  .ressource-card:nth-child(6),
  .video-card:nth-child(6) {
    animation-delay: 300ms;
  }

  @keyframes card-rise {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ── Responsive ───────────────────────────────────────────── */

.menu-toggle {
  display: none;
}

@media (max-width: 900px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
    padding: 3rem 6%;
    min-height: auto;
  }
  .hero-section::before,
  .hero-section::after {
    display: none;
  }
  .hero-content {
    max-width: 100%;
  }
  .hero-image img {
    max-width: 340px;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0.9rem 4%;
  }

  .menu-toggle {
    display: flex;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
  }

  .menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: 0.3s;
  }

  nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #0b1329;
    padding: 1.5rem 0;
    text-align: center;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
    gap: 1rem;
    overflow-x: visible;
  }

  nav.active {
    display: flex;
  }

  nav a {
    font-size: 15px;
    padding: 8px 10px;
    letter-spacing: 1px;
  }

  .hero-content h1 {
    font-size: 1.85rem;
  }

  .matieres-section,
  .material-page,
  .videos-section,
  .avis-section {
    padding-left: 4%;
    padding-right: 4%;
  }

  .ressource-grid {
    grid-template-columns: 1fr;
  }
  .videos-grid {
    grid-template-columns: 1fr;
  }

  .footer-s1-2 {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-links {
    gap: 1rem;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.55rem;
  }
  .matieres-section .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.arabic-text {
  font-family: "Cairo", sans-serif !important;
  direction: rtl !important; /* إجبار الاتجاه من اليمين لليسار */
  text-align: right !important; /* إجبار المحاذاة لليمين */
  unicode-bidi: embed;
  line-height: 1.9;
  color: var(--text);
  margin-top: 20px;
}

.arabic-text p {
  direction: rtl !important;
  text-align: right !important;
  margin-bottom: 12px;
}
