/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== BASE ===== */
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #0f172a;
  color: #e5e7eb;
  line-height: 1.7;
}

.container {
  max-width: 1100px;
  margin: auto;
  padding: 30px 20px;
}

/* ===== HEADER ===== */
.header {
  background: #111827;
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  /* garde le menu responsive */
}

.logo {
  font-size: 1.4rem;
  font-weight: 600;
  color: #38bdf8;
}

.nav {
  display: flex;
  gap: 30px;
  list-style: none;
  flex-wrap: wrap;
}

.nav li {
  position: relative;
}

.nav a {
  text-decoration: none;
  color: #e5e7eb;
  font-weight: 500;
  padding-bottom: 5px;
  border-bottom: 2px solid transparent;
  transition: 0.2s;
}

.nav a:hover,
.nav .active {
  color: #38bdf8;
  border-color: #38bdf8;
}

/* ===== HERO ===== */
.hero {
  background: radial-gradient(circle at top,
      rgba(56, 189, 248, 0.15),
      transparent 70%);
  text-align: center;
  padding: 80px 20px;
}

.hero h2 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.hero p {
  color: #9ca3af;
  max-width: 600px;
  margin: auto;
}

/* ===== SECTIONS ===== */
.section {
  margin-top: 40px;
}

.section h2 {
  margin-bottom: 20px;
  font-size: 1.6rem;
}

/* ===== BLOCS ===== */
.card,
.category,
.article-preview,
.download-list li,
.contact-form {
  background: #1e293b;
  border-radius: 16px;
  padding: 25px;
  border: 1px solid rgba(56, 189, 248, 0.15);
}

.card {
  position: relative;
  /* ESSENTIEL */
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  overflow: visible;
  /* s’assurer que rien ne masque le badge */
  color: #f8f8f2;
  /* texte clair */
}

/* Numéro de la card */
.card-number {
  position: absolute;
  top: -85px;
  /* décalage vers le haut, dépasse le bord */
  left: -80px;
  font-size: 7rem;
  /* grand chiffre */
  font-weight: bold;
  color: rgba(56, 189, 248, 0.2);
  /* bleu ciel très transparent */
  z-index: 10;
  pointer-events: none;
  /* pas cliquable */
}

/* Catégorie en bas à droite */
.card .category {
  position: absolute;
  bottom: 15px;
  right: 15px;
  font-size: 0.8rem;
  background: #eee;
  padding: 4px 8px;
  color: rgba(56, 189, 248, 0.2);
}

/* ===== CATEGORIES ===== */
.category {
  margin-bottom: 35px;
}

.category h3 {
  color: #38bdf8;
  margin-bottom: 5px;
}

.category-desc {
  color: #9ca3af;
  margin-bottom: 20px;
}

/* ===== CARDS ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
}

.card h4,
.card h3 {
  color: #e5e7eb;
}

.card p {
  color: #9ca3af;
  margin-bottom: 15px;
}

/* ===== LINKS & BUTTONS ===== */
a {
  color: #38bdf8;
}

a:hover {
  color: #0ea5e9;
}

.btn {
  display: inline-block;
  background: transparent;
  color: #38bdf8;
  border: 1px solid #38bdf8;
  padding: 8px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
  transition: 0.2s;
}

.btn:hover {
  background: #38bdf8;
  color: #0f172a;
}

/* ===== DOWNLOADS ===== */
.download-list {
  list-style: none;
  display: grid;
  gap: 15px;
}

/* ===== FORM ===== */
.contact-form {
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact-form input,
.contact-form textarea {
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #38bdf8;
}

/* ===== FOOTER ===== */
.footer {
  margin-top: 60px;
  padding: 30px 0;
  text-align: center;
  color: #9ca3af;
  border-top: 1px solid rgba(56, 189, 248, 0.15);
}

.card+.card {
  margin-top: 25px;
}

/* ===== DROPDOWN MENU (FIX UX) ===== */

.dropdown {
  position: relative;
}

/* lien principal */
.dropdown-toggle {
  cursor: pointer;
}

/* sous-menu */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: #1e293b;
  border-radius: 12px;
  padding: 10px;
  min-width: 220px;

  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(56, 189, 248, 0.25);

  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s;

  z-index: 200;
}

/* zone tampon invisible */
.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  width: 100%;
  height: 12px;
}

/* éléments */
.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: #e5e7eb;
  font-weight: 500;
}

.dropdown-menu a:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
}

/* activation */
.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.logo img {
  display: block;
}

.code-wrapper {
  position: relative;
  /* nécessaire pour placer le bouton par rapport au bloc */
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: transparent;
  /* plus de fond */
  color: #38bdf8;
  /* accent bleu ciel */
  border: none;
  /* plus de bordure */
  border-radius: 12px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.2s ease;
  z-index: 1000;
}

.copy-btn:hover {
  color: #0ea5e9;
  /* bleu ciel plus vif au survol */
}

.copy-btn:active {
  transform: scale(0.95);
}

/* Fix overflow du pre qui pourrait masquer le bouton */
pre[class*="language-"].line-numbers {
  position: relative;
  /* permet au bouton de rester visible */
  background: #1e293b !important;
  border-radius: 12px;
  padding: 15px 15px 15px 50px;
  overflow-x: auto;
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-size: 0.95rem;
}

/* Scrollbar pour Firefox */
pre[class*="language-"]::-moz-scrollbar {
  width: 12px;
  height: 12px;
}

pre[class*="language-"]::-moz-scrollbar-thumb {
  background-color: #38bdf8;
  /* accent bleu ciel */
  border-radius: 10px;
  border: 3px solid #1e293b;
  /* fond du bloc */
}

pre[class*="language-"]::-moz-scrollbar-track {
  background: #1e293b;
  /* fond du bloc */
  border-radius: 10px;
}

/* Scrollbar pour Chrome, Edge, Safari */
pre[class*="language-"]::-webkit-scrollbar {
  height: 10px;
  /* horizontal */
  width: 10px;
  /* vertical */
}

pre[class*="language-"]::-webkit-scrollbar-thumb {
  background-color: #38bdf8;
  /* accent bleu ciel */
  border-radius: 10px;
  border: 3px solid #1e293b;
  /* espace autour */
}

pre[class*="language-"]::-webkit-scrollbar-track,
pre[class*="language-"]::-moz-scrollbar-track {
  background: #2c3e5c;
  /* harmonisation avec le fond */
}

pre[class*="language-"].line-numbers {
  position: relative;
  background: #0f172a !important;
  /* nouveau fond plus doux */
  border-radius: 12px;
  padding: 15px 15px 15px 50px;
  overflow-x: auto;
  border: 1px solid rgba(56, 189, 248, 0.25);
  /* accent bleu ciel */
  font-size: 0.95rem;
  color: #f8f8f2;
  /* texte clair pour la lisibilité */
}

/* ===== TABLEAUX ===== */
.table-wrapper {
  overflow-x: auto;
  /* responsive mobile */
  margin: 25px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #1e293b;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

thead {
  background: rgba(56, 189, 248, 0.12);
}

thead th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: #38bdf8;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
}

tbody td {
  padding: 14px 16px;
  color: #e5e7eb;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.12);
}

/* lignes alternées */
tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* hover */
tbody tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

/* dernière ligne */
tbody tr:last-child td {
  border-bottom: none;
}

/* ===== IMAGES TUTORIEL ===== */
.img_tutoriel {
  display: block;
  max-width: 100%;
  margin: 25px auto;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* option : image cliquable ou zoomable */
.img_tutoriel:hover {
  box-shadow: 0 14px 40px rgba(56, 189, 248, 0.25);
}

/* ===== IMAGES TUTORIEL ===== */
.icons_tutoriel {
  margin-left: 10px;
  margin-right: 5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* option : image cliquable ou zoomable */
.icons_tutoriel:hover {
  box-shadow: 0 14px 40px rgba(56, 189, 248, 0.25);
}

.tutoriel-card {
  display: flex !important;
  /* force flex horizontal */
  flex-direction: row !important;
  /* assure horizontal */
  align-items: center;
  gap: 25px;
  width: 100%;
  /* utilise toute la largeur possible */
  box-sizing: border-box;
  /* éviter débordement */
}

.tutoriel-content {
  flex: 1 1 auto;
  /* occupe l’espace restant */
  min-width: 0;
  /* pour gérer correctement overflow */
}

.tutoriel-img {
  width: 180px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  /* pas réduire l’image */
}

@media (max-width: 700px) {
  .tutoriel-card {
    flex-direction: column-reverse !important;
    /* mobile: image en bas */
    align-items: stretch;
  }

  .tutoriel-img {
    width: 100%;
    height: 160px;
  }
}

/* ===== LISTES TUTORIELS STYLE ÉTAPES ===== */
.category ul,
.card ul {
  list-style: none;
  padding-left: 0;
  margin: 15px 0;
}

.category li,
.card li {
  position: relative;
  background: #1e293b;
  /* fond sombre */
  color: #e5e7eb;
  /* texte clair */
  padding: 15px 20px 15px 60px;
  /* espace pour le badge */
  margin-bottom: 12px;
  border-radius: 12px;
  /* coins arrondis */
  transition: background 0.2s ease, transform 0.2s ease;
  border: 1px solid rgba(56, 189, 248, 0.15);
}

/* hover */
.category li:hover,
.card li:hover {
  background: rgba(56, 189, 248, 0.08);
  transform: translateX(3px);
}


.tutorial-nav {
  text-align: center;
  margin: 30px 0;
  display: flex;
  justify-content: center;
  gap: 20px; /* espace entre les boutons */
  flex-wrap: wrap; /* pour mobile */
}
