/* ============================================================
   🎨 theme.css — Thème clair/sombre + styles communs
   À inclure sur TOUTES les pages du site
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== Variables de thème ===== */
:root {
  --bg: #ffffff;
  --text: #111111;
  --text-muted: #666666;
  --border: #eeeeee;
  --grid-bg: #f0f0f0;
  --thumb-bg: #dddddd;
  --footer-bg: #fafafa;
  --hr-bg: #dddddd;
  --pill-bg: #f0f0f0;
  --pill-text: #000000;
  --pill-hover-bg: #000000;
  --pill-hover-text: #ffffff;
  --search-bg: #ffffff;
  --search-border: #dddddd;
  --link: #e91e63;
  --link-hover: #c2185b;
  --link-hover-bg: rgba(233, 30, 99, 0.08);
  --toggle-shadow: rgba(0,0,0,0.15);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #121212;
  --text: #f2f2f2;
  --text-muted: #aaaaaa;
  --border: #2a2a2a;
  --grid-bg: #1e1e1e;
  --thumb-bg: #2a2a2a;
  --footer-bg: #1a1a1a;
  --hr-bg: #333333;
  --pill-bg: #2a2a2a;
  --pill-text: #f2f2f2;
  --pill-hover-bg: #f2f2f2;
  --pill-hover-text: #121212;
  --search-bg: #1e1e1e;
  --search-border: #555555;
  --link: #f06292;
  --link-hover: #ff8fab;
  --link-hover-bg: rgba(240, 98, 146, 0.12);
  --toggle-shadow: rgba(0,0,0,0.6);
  color-scheme: dark;
}

/* ===== Base ===== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}
header {
  text-align: center;
  padding: 24px 16px;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s ease;
}
header h1 { font-size: 28px; font-weight: 600; margin-bottom: 4px; }
header p { color: var(--text-muted); font-size: 14px; }

/* ===== Barre de recherche ===== */
.search-wrapper {
  margin-top: 16px;
  max-width: 500px;
  margin: 16px auto 0;
}
#search-input {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  border: 1px solid var(--search-border);
  background: var(--search-bg);
  color: var(--text);
  border-radius: 24px;
  outline: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
#search-input::placeholder { color: var(--text-muted); opacity: 1; }

/* ===== Grille de miniatures ===== */
#grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--grid-bg);
  padding: 2px;
  transition: background-color 0.3s ease;
}
@media (max-width: 768px) {
  #grid { grid-template-columns: repeat(2, 1fr); }
}
.thumbnail-item {
  aspect-ratio: 1/1;
  background: var(--thumb-bg);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background-color 0.3s ease;
}
.thumbnail-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
}
[data-theme="dark"] .thumbnail-item img { filter: brightness(0.85); }
.thumbnail-item:hover img { transform: scale(1.05); filter: brightness(1); }
.thumbnail-item .title {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 8px;
  font-size: 11px;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== Player Modal ===== */
#player-container {
  display: none;
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.95);
  z-index: 1000;
  flex-direction: column;
  align-items: center; justify-content: center;
}
#player-container.active { display: flex; }
#close-btn {
  position: absolute; top: 20px; right: 20px;
  background: rgba(255,255,255,0.2);
  color: white; border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 24px; cursor: pointer;
  z-index: 1002;
}
#video-title {
  color: white;
  margin-top: 16px;
  font-size: 18px;
  max-width: 80%;
  text-align: center;
}
#player-wrapper {
  width: 95vw;
  max-width: 800px;
  aspect-ratio: 16/9;
}
.video-js { width: 100%; height: 100%; border-radius: 8px; overflow: hidden; }

/* ===== Footer ===== */
footer { margin-top: 40px; padding: 24px 16px; border-top: 1px solid var(--border); background: var(--footer-bg); transition: background-color 0.3s ease, border-color 0.3s ease; }
footer hr { border: 0; height: 1px; background: var(--hr-bg); margin: 12px 0; transition: background-color 0.3s ease; }
footer .nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin: 12px 0; }
footer .nav-links a { text-decoration: none; color: var(--pill-text); font-size: 15px; font-weight: 600; padding: 8px 16px; border-radius: 20px; transition: all 0.2s ease; background: var(--pill-bg); }
footer .nav-links a:hover { background: var(--pill-hover-bg); color: var(--pill-hover-text); }
footer .main-links { display: flex; justify-content: center; gap: 24px; margin-top: 12px; flex-wrap: wrap; }
footer .main-links a { text-decoration: none; color: var(--link); font-weight: 600; font-size: 16px; padding: 6px 12px; border-radius: 12px; transition: background 0.2s; }
footer .main-links a:hover { background: var(--link-hover-bg); color: var(--link-hover); }

/* ===== Commentaires en mode sombre ===== */
[data-theme="dark"] #HCB_comment_box {
  background: #1a1a1a;
  color: #eeeeee;
  border-radius: 8px;
  padding: 12px;
}
[data-theme="dark"] #HCB_comment_box a { color: #f06292; }
[data-theme="dark"] #HCB_comment_box input,
[data-theme="dark"] #HCB_comment_box textarea {
  background: #2a2a2a;
  color: #eeeeee;
  border: 1px solid #444444;
}

/* ===== 🌙 Bouton de bascule du thème ===== */
#theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 20px;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 2px 8px var(--toggle-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
}
#theme-toggle:hover { transform: scale(1.1); }