/* =========================================================
   BASE GÉNÉRALE DU SITE
   ========================================================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  background: #f5f5f7;
  color: #222;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

/* =========================================================
   EN-TÊTE ET PIED DE PAGE
   ========================================================= */

.site-header,
.site-footer {
  background: #1f2933;
  color: #fff;
  padding: 1rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 120px;
}

.header-left {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.site-header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2.4rem;
}

.header-right {
  display: flex;
  align-items: center;
  height: 100%;
  overflow: hidden;
}

.site-logo {
  width: auto;
  height: 100px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-footer p {
  margin: 0;
  text-align: center;
}

/* Logo Flash spécifique (autres pages) */
.header-flash-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.header-flash-logo object {
  display: block;
  height: 150px;
  width: auto;
}

/* Responsive header */
@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
  }

  .header-right {
    justify-content: center;
  }

  .site-logo {
    height: 100px;
  }
}

/* =========================================================
   NAVIGATION
   ========================================================= */

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.main-nav a {
  color: #e5e7eb;
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 0.25rem;
  font-size: 0.9rem;
}

.main-nav a.active,
.main-nav a:hover {
  background: #374151;
}

.main-nav a:focus,
.main-nav a:hover {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

/* =========================================================
   CONTENEUR GÉNÉRAL DE CONTENU
   ========================================================= */

.content {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1rem 2rem;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* largeur de lecture générale (index + VB) */
main p {
  max-width: none;
}

.intro p {
  margin-bottom: 0.75rem;
}

/* =========================================================
   GRILLE D’ANIMATIONS (AUTRES PAGES)
   ========================================================= */

.animation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.animation-card {
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.animation-card img.card-thumb {
  display: block;
  max-width: 360px;
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 0.25rem;
  margin: 0 auto 0.5rem;
}

.animation-card h3 {
  font-size: 1rem;
  text-align: center;
  margin: 0.25rem 0;
}

.card-tags {
  font-size: 0.85rem;
  color: #555;
  text-align: center;
}

.card-media {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}

.card-media img {
  width: 50%;
  height: auto;
}

.card-excerpt {
  font-size: 0.9rem;
  color: #444;
  margin: 0.5rem 0 0;
  text-align: left;
  width: 100%;
  flex: 1 1 auto;
}

.animation-card .btn {
  margin-top: auto;
  align-self: stretch;
  text-align: center;
}

/* =========================================================
   FICHE ANIMATION (PAGE DÉTAIL)
   ========================================================= */

.animation-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.animation-detail h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.animation-page .animation-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.animation-preview {
  max-width: 280px;
  width: 100%;
  border-radius: 0.5rem;
}

.animation-meta {
  flex: 1;
  min-width: 220px;
}

.animation-description {
  margin-top: 0.5rem;
}

/* Responsive fiche animation + profil */
@media (max-width: 640px) {
  .animation-page .animation-info {
    flex-direction: column;
    align-items: center;
  }

  .animation-preview {
    max-width: 220px;
  }

  .profile {
    flex-direction: column;
    text-align: center;
  }

  .profile-text {
    min-width: auto;
  }
}

/* Lecteur Flash (Ruffle) */
.flash-container {
  width: 100%;
  max-width: 640px;
  height: 360px;
  margin: 0 auto;
  background: #111;
  border-radius: 0.5rem;
  overflow: hidden;
}

/* =========================================================
   FORMULAIRE ÉTOILÉ - DESIGN MODERNE GLASSMORPHISM
   ========================================================= */

.feedback-form,
.rating,
.comments form,
.downloads form {
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 24px;
  padding: 2.5rem;
  margin: 2rem 0;
  box-shadow: 
    0 20px 40px rgba(0,0,0,0.1),
    0 0 0 1px rgba(255,255,255,0.05) inset;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Labels élégants */
.feedback-form label,
.rating label,
.comments label {
  display: block;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}

/* SELECT ÉTOILES - ANIMÉ */
.rating-group select,
select[name="rating"] {
  width: 100%;
  padding: 1.2rem 1.5rem;
  font-size: 1.1rem;
  border: 2px solid rgba(52,152,219,0.2);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
  box-shadow: 
    0 8px 32px rgba(0,0,0,0.1),
    inset 0 1px 0 rgba(255,255,255,0.8);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3e%3cpath stroke='%238B5CF6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19.92 11.62L12.56 10.23l2.39-7.38L14 2l-5.5 5.5-5.5-5.5.92 8.38L2 11.62l7.38 2.39L9.77 22l5.5-5.5 5.5 5.5-1.85-8.38z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1.2rem center;
  background-size: 20px;
  padding-right: 3rem;
}

.rating-group select:hover,
select[name="rating"]:hover {
  border-color: #6366f1;
  box-shadow: 
    0 12px 40px rgba(99,102,241,0.3),
    inset 0 1px 0 rgba(255,255,255,0.9);
  transform: translateY(-2px);
}

.rating-group select:focus,
select[name="rating"]:focus {
  outline: none;
  border-color: #8B5CF6;
  box-shadow: 
    0 0 0 4px rgba(139,92,246,0.2),
    0 20px 40px rgba(139,92,246,0.15);
}

/* TEXTAREA élégant */
.field-group textarea,
input[type="email"],
input[type="text"] {
  width: 100%;
  min-height: 140px;
  padding: 1.2rem 1.5rem;
  border: 2px solid rgba(52,152,219,0.2);
  border-radius: 16px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
  box-shadow: 
    0 8px 32px rgba(0,0,0,0.1),
    inset 0 1px 0 rgba(255,255,255,0.8);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.field-group textarea:hover,
input[type="email"]:hover,
input[type="text"]:hover {
  border-color: #6366f1;
  transform: translateY(-1px);
}

.field-group textarea:focus,
input[type="email"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #8B5CF6;
  box-shadow: 
    0 0 0 4px rgba(139,92,246,0.2),
    0 20px 40px rgba(139,92,246,0.15);
}

/* BOUTON ENVOI - SPECTACULAIRE */
.feedback-form button[type="submit"],
button.btn-submit {
  width: 100%;
  padding: 1.4rem 2.5rem;
  background: linear-gradient(135deg, #8B5CF6 0%, #6366f1 50%, #4F46E5 100%);
  color: white !important;
  border: none;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 12px 40px rgba(139,92,246,0.4),
    inset 0 1px 0 rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.feedback-form button[type="submit"]:hover,
button.btn-submit:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 20px 50px rgba(139,92,246,0.5),
    inset 0 1px 0 rgba(255,255,255,0.4);
}

.feedback-form button[type="submit"]:active,
button.btn-submit:active {
  transform: translateY(-2px);
}

/* Étoiles animées dans options */
.rating-group select option:checked {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  color: #1f2937;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .feedback-form {
    padding: 2rem;
    margin: 1.5rem 1rem;
  }
}


/* =========================================================
   PROFIL (PAGE À PROPOS)
   ========================================================= */

.profile {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  align-items: center;
}

.profile-photo {
  flex: 0 0 140px;
  display: flex;
  justify-content: center;
}

.profile-photo img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.profile-text {
  flex: 1;
  min-width: 220px;
}

.profile-text h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.profile-text p {
  margin-bottom: 0.5rem;
}

/* =========================================================
   BOUTONS GÉNÉRIQUES
   ========================================================= */

.btn {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: #2563eb;
  color: #fff;
  border-radius: 0.25rem;
  text-decoration: none;
  text-align: center;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 1;
}

.btn.secondary {
  background: #6b7280;
}

.btn:hover {
  background: #1d4ed8;
}

/* =========================================================
   BLOCS INFO GÉNÉRIQUES
   ========================================================= */

.info-box {
  background-color: #fff5e6;
  border-left: 4px solid #ff9800;
  padding: 1rem 1.25rem;
  margin: 1rem 0 2rem;
}

.info-box h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

/* =========================================================
   GRILLE DE CARTES (VB + QCM) – 2 colonnes
   ========================================================= */

.card-grid {
  display: grid;
  gap: 1.5rem;
  margin: 1rem 0 2rem;
}

/* 1 colonne sur petits écrans, 2 colonnes sinon */
@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Carte générique */
.card {
  background-color: #ffffff;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: auto;
  display: block;
}

/* Corps de carte commun (VB + QCM) */
.card-body {
  padding: 0.9rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.5rem;
}

/* Texte dans les cartes : sert de tampon pour aligner les boutons */
.card-body p {
  line-height: 1.4;
  flex-grow: 1;
}

/* =========================================================
   BOUTONS DANS LES CARTES
   ========================================================= */

.btn-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.btn-online {
  background-color: #1976d2;
  color: #ffffff;
}

.btn-download {
  background-color: #388e3c;
  color: #ffffff;
}

.btn:focus,
.btn:hover {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

/* Badge vbX */
.tag {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  background-color: #9c27b0;
  color: #ffffff;
  border-radius: 999px;
}

/* Petite aide dans la carte runtime */
.help-text {
  font-size: 0.85rem;
  color: #555555;
  margin-top: 0.4rem;
}

/* =========================================================
   SPÉCIFIQUE VISUAL BASIC
   ========================================================= */

/* Runtime : centrer réellement le bloc */
.card-grid.runtime-grid {
  display: block;
}

.card-grid.runtime-grid .card-runtime {
  max-width: 520px;
  width: 100%;
  margin: 0 auto 2rem auto;
}

/* Image runtime : taille naturelle, simplement centrée */
.card-runtime .runtime-img {
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0.5rem auto;
}

/* Cartes principales VB (vb1–vb3) : même hauteur + bouton en bas */
.vb-main-card {
  display: flex;
  flex-direction: column;
}

.vb-main-card .card-body {
  flex: 1 1 auto;
}

.vb-main-card .card-body p {
  flex-grow: 1;
}

.vb-main-card .card-body .btn {
  margin-top: 0.6rem;
}

/* Images vb1–vb3 : zone d’image uniforme sans recadrage agressif */
.vb-main-card > img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background-color: #f5f5f7;
}

/* =========================================================
   QCM (section vb4–vb14)
   ========================================================= */

/* Images QCM plus petites (divisées par deux) – limitées à la section QCM */
.qcm-section .card img[src*="qcm.jpg"] {
  width: 50%;
  height: auto;
  margin: 0.5rem auto;
}

/* Trois boutons par QCM : adaptables, restent propres à l'affichage */
.qcm-section .btn-row {
  flex-wrap: wrap;
}

.qcm-section .btn-row .btn {
  flex: 1 1 auto;
  min-width: 9rem;
}

/* Sur très petit écran, autoriser les boutons à passer à la ligne */
@media (max-width: 480px) {
  .btn-row {
    flex-wrap: wrap;
  }
}

/* ========================================================
	Barre RESEAUX SOCIAUX
   ======================================================== */
/* Boutons réseaux sociaux avec SVG précis */
.share-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef2f7, #dfe6ee);
  border: 1px solid #c9d3df;
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.share-label {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-right: 6px;
}

/* bouton */
.share-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  text-decoration: none;
  outline: none;
}

/* couleurs officielles */
.share-btn.facebook { background: linear-gradient(180deg,#1877f2,#145db8); }
.share-btn.x        { background: linear-gradient(180deg,#000000,#222222); }
.share-btn.linkedin { background: linear-gradient(180deg,#0a66c2,#084f9a); }
.share-btn.whatsapp { background: linear-gradient(180deg,#25d366,#1aa85a); }
.share-btn.email    { background: linear-gradient(180deg,#6b7280,#4b5563); }

/* SVG blanc et taille */
.share-btn svg { width: 20px; height: 20px; fill: #ffffff; display: block; }

/* Hover et focus */
.share-btn:hover,
.share-btn:focus {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  filter: saturate(1.05);
}

/* Focus keyboard visible */
.share-btn:focus {
  box-shadow: 0 0 0 4px rgba(99,102,241,0.12), 0 10px 24px rgba(0,0,0,0.18);
  border: 2px solid rgba(255,255,255,0.06);
}

/* petite animation d'apparition */
.share-btn { will-change: transform, box-shadow; }

/* Responsive */
@media (max-width: 480px) {
  .share-bar { gap: 10px; padding: 10px; }
  .share-btn { width: 40px; height: 40px; }
  .share-btn svg { width: 18px; height: 18px; }
}

/* Pages concernées */
.page-electro .card-media img,
.page-electrotechnique .card-media img,
.page-electronique .card-media img,
.page-automatisme .card-media img,
.page-physique .card-media img,
.page-jeux-educatifs .card-media img,
.page-enfants .card-media img {
  width: 50%;        /* réduit l’image de moitié */
  height: auto;      /* garde les proportions */
  max-width: 100%;   /* évite les débordements */
  display: block;
  margin: 0 auto;    /* centre l’image */
}

@media (max-width: 640px) {
  .animation-detail .card-media img.reduced-thumb {
    max-width: 80%;
  }
}

@media (max-width: 768px) {
  .page-electro .card-media img,
  .page-electronique .card-media img,
  .page-automatisme .card-media img,
  .page-physique .card-media img,
  .page-enfants .card-media img {
    width: 100%;
  }
}

:root {
  --primary: #2563eb;
  --secondary: #6b7280;
  --bg-light: #f5f5f7;
}

/* Titre principal des fiches animation */
.animation-detail h1.animation-title {
  text-align: center;
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: #1f2933; /* cohérent avec ton thème */
}

/* Sous-titres des fiches animation */
.animation-detail h2.animation-subtitle {
  text-align: center;
  font-weight: 700;
  font-size: 1.4rem;
  margin: 1.8rem 0 1rem;
  color: #2c3e50;
}

.lang-switcher {
  display: flex;
  gap: 8px;
  margin-left: 20px;
}

.lang-btn {
  background: #eee;
  border: 1px solid #ccc;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  border-radius: 4px;
  transition: 0.2s;
}

.lang-btn:hover {
  background: #ddd;
}

.lang-btn.active {
  background: #0078d4;
  color: white;
  border-color: #0078d4;
}


@media (max-width: 640px) {
  .animation-detail h1.animation-title {
    font-size: 1.6rem;
  }

  .animation-detail h2.animation-subtitle {
    font-size: 1.2rem;
  }
}

