@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

/* ═══════════════════════════════════════════════
   THÈME CLAIR (défaut — Windows 98 classique)
═══════════════════════════════════════════════ */
:root {
  --win-bg: #008080;
  --win-face: #c0c0c0;
  --win-dark: #808080;
  --win-darker: #404040;
  --win-white: #ffffff;
  --win-black: #000000;
  --win-blue: #000080;
  --win-title-active: linear-gradient(to right, #000080, #1084d0);
  --win-inset-bg: #ffffff;
  --win-text: #000000;
  --win-text-muted: #404040;
  --win-link: #000080;
  --win-link-active: #ff0000;
  --win-sidebar-title: #404040;
  --win-main-bg: #ffffff;
  --win-icon-color: #ffffff;
  --win-btn-color: #000000;
  --win-taskbar-border: #ffffff;
}

/* ═══════════════════════════════════════════════
   THÈME SOMBRE — Gris sombre
═══════════════════════════════════════════════ */
html.dark {
  --win-bg: #1a1a1a;
  --win-face: #2d2d2d;
  --win-dark: #444444;
  --win-darker: #1a1a1a;
  --win-white: #555555;
  --win-black: #0d0d0d;
  --win-blue: #4a9eff;
  --win-title-active: linear-gradient(to right, #1f1f1f, #3a3a3a);
  --win-inset-bg: #1e1e1e;
  --win-text: #e0e0e0;
  --win-text-muted: #888888;
  --win-link: #4a9eff;
  --win-link-active: #7fc4ff;
  --win-sidebar-title: #888888;
  --win-main-bg: #1e1e1e;
  --win-icon-color: #e0e0e0;
  --win-btn-color: #e0e0e0;
  --win-taskbar-border: #444444;
}

/* Transitions fluides au changement de thème */
body, .window, .sidebar, .main-area, .statusbar,
#taskbar, .window-titlebar, .menubar, .toolbar,
.addressbar, .win-btn, .toolbar-btn, .win-button,
.taskbar-btn, #start-btn, .inset-box,
.progress-bar-container, .win-form input,
.win-form textarea, .win-form select,
.addressbar input, .content-header {
  transition: background-color 0.25s ease, color 0.25s ease,
              border-color 0.25s ease, box-shadow 0.25s ease;
}

/* ── Overrides dark spécifiques ─────────────────── */
html.dark { color: var(--win-text); }
html.dark .window { box-shadow: 1px 1px 0 #000; }
html.dark .main-area { background: var(--win-main-bg); }
html.dark .sidebar { background: var(--win-face); color: var(--win-text); }
html.dark .sidebar-title { color: var(--win-sidebar-title); border-bottom-color: var(--win-dark); }
html.dark .sidebar-link { color: var(--win-link); }
html.dark .sidebar-link:hover { color: var(--win-link-active); }
html.dark .sidebar-link.active { color: var(--win-link-active); }
html.dark .menubar { background: var(--win-face); color: var(--win-text); border-bottom-color: var(--win-dark); }
html.dark .menu-item:hover { background: var(--win-blue); color: #000; }
html.dark .toolbar { background: var(--win-face); border-bottom-color: var(--win-dark); }
html.dark .toolbar-btn { background: var(--win-face); color: var(--win-text); }
html.dark .addressbar { background: var(--win-face); border-bottom-color: var(--win-dark); }
html.dark .addressbar label { color: var(--win-text); }
html.dark .addressbar input { background: var(--win-inset-bg); color: var(--win-text); border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker); }
html.dark .win-btn { background: var(--win-face); color: var(--win-btn-color); }
html.dark .statusbar { background: var(--win-face); border-top-color: var(--win-dark); color: var(--win-text); }
html.dark .statusbar-pane { border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker); }
html.dark #taskbar { background: var(--win-face); border-top-color: var(--win-taskbar-border); }
html.dark .taskbar-btn { background: var(--win-face); color: var(--win-text); border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker); }
html.dark #start-btn { background: var(--win-face); color: var(--win-text); border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white); }
html.dark .taskbar-clock { border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker); color: var(--win-text); }
html.dark .taskbar-separator { border-left-color: var(--win-dark); border-right-color: var(--win-darker); }
html.dark .win-button { background: var(--win-face); color: var(--win-text); border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white); }
html.dark .section-title { color: var(--win-blue); border-bottom-color: var(--win-blue); }
html.dark .inset-box { background: var(--win-inset-bg); color: var(--win-text); border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker); }
html.dark .win-form input,
html.dark .win-form textarea,
html.dark .win-form select { background: var(--win-inset-bg); color: var(--win-text); border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker); }
html.dark .progress-bar-fill { background: var(--win-blue); }
html.dark .counter-digit { background: #020810; color: #00b4ff; }
html.dark .marquee-box { background: #020810; color: #00b4ff; }
html.dark p { color: var(--win-text); }
html.dark a { color: var(--win-link); }
html.dark .desktop-icon { color: var(--win-icon-color); }
html.dark .blink { color: #00ffcc; }
html.dark .content-header { background: linear-gradient(to right, #1a1a1a, #3a3a3a); }

/* Lueur néon sur les éléments clés en mode sombre */
html.dark .window-titlebar {  }
html.dark .section-title {  }
html.dark .sidebar-link:hover {  }

/* ── Toggle bouton ─────────────────────────────── */
#theme-toggle {
  height: 22px;
  padding: 0 8px;
  background: var(--win-face);
  border: 1px solid;
  border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white);
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--win-text);
  white-space: nowrap;
  transition: all 0.2s ease;
}
#theme-toggle:hover {
  background: var(--win-blue);
  color: white;
}
#theme-toggle:active {
  border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker);
}
html.dark #theme-toggle {
  background: var(--win-face);
  color: var(--win-text);
  border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white);
  
}
html.dark #theme-toggle:hover {
  background: var(--win-blue);
  color: #000;
  
}

#desktop {
  padding: 10px;
  min-height: calc(100vh - 30px);
  position: relative;
}

/* Desktop icons */
.desktop-icons {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: absolute;
  top: 15px;
  left: 15px;
}
.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  width: 72px;
  text-align: center;
  color: white;
  text-shadow: 1px 1px 1px #000;
  font-size: 11px;
  padding: 4px;
  border: 1px dotted transparent;
}
.desktop-icon:hover { border-color: white; background: rgba(0,0,128,0.4); }
.icon-img { font-size: 32px; line-height: 1; display: block; }

/* Window */
.window {
  background: var(--win-face);
  border: 2px solid;
  border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white);
  box-shadow: 1px 1px 0 #000;
  position: absolute;
  animation: slideIn 0.15s ease-out;
}

/* ── Fenêtre principale responsive ─────────────────────────────────────────
   La largeur/hauteur par défaut définies par page (.window.main-window)
   servent de TAILLE MAXIMALE souhaitée ; sur les petits écrans, la fenêtre
   se réduit automatiquement pour ne jamais dépasser le viewport.
   La position (left/top) et la hauteur du contenu (.window-content) sont
   recalculées en JS (voir win98.js → initResponsiveWindow) pour s'adapter
   précisément à la résolution du navigateur, y compris au redimensionnement. */
.window.main-window {
  max-width: 96vw;
  box-sizing: border-box;
}
.window.main-window .window-content {
  box-sizing: border-box;
}
@keyframes slideIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* Title bar */
.window-titlebar {
  background: var(--win-title-active);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 4px;
  user-select: none;
  cursor: default;
}
.window-title {
  font-weight: bold;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.window-controls { display: flex; gap: 2px; }
.win-btn {
  width: 16px; height: 14px;
  background: var(--win-face);
  border: 1px solid;
  border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 9px; font-weight: bold; color: black; line-height: 1;
}
.win-btn:active { border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker); }

/* Menu bar */
.menubar {
  display: flex;
  padding: 2px 4px;
  border-bottom: 1px solid var(--win-dark);
}
.menu-item { padding: 2px 6px; cursor: pointer; font-size: 11px; }
.menu-item:hover { background: var(--win-blue); color: white; }

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  border-bottom: 1px solid var(--win-dark);
}
.toolbar-btn {
  background: var(--win-face);
  border: 1px solid transparent;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 11px;
  display: flex; align-items: center; gap: 3px;
}
.toolbar-btn:hover { border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white); }
.toolbar-btn:active { border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker); }
.toolbar-separator { width: 1px; height: 22px; background: var(--win-dark); margin: 0 3px; border-right: 1px solid var(--win-white); }

/* Address bar */
.addressbar {
  display: flex;
  align-items: center;
  padding: 2px 4px;
  gap: 4px;
  border-bottom: 1px solid var(--win-dark);
}
.addressbar label { font-size: 11px; white-space: nowrap; }
.addressbar input {
  flex: 1;
  background: white;
  border: 1px solid;
  border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker);
  padding: 1px 4px;
  font-family: inherit; font-size: 11px; outline: none;
}

/* Window body */
.window-content { display: flex; }

/* Sidebar */
.sidebar {
  width: 150px;
  border-right: 1px solid var(--win-dark);
  padding: 8px;
  background: var(--win-face);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.sidebar-title {
  font-weight: bold;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--win-darker);
  margin-bottom: 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--win-dark);
}
.sidebar-link {
  color: var(--win-blue);
  text-decoration: underline;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 0;
  display: block;
}
.sidebar-link:hover { color: #ff0000; }
.sidebar-link.active { color: #ff0000; font-weight: bold; text-decoration: none; }

/* Main area */
.main-area {
  flex: 1;
  overflow-y: auto;
  background: white;
}
.main-area::-webkit-scrollbar { width: 16px; }
.main-area::-webkit-scrollbar-track { background: var(--win-face); }
.main-area::-webkit-scrollbar-thumb {
  background: var(--win-face);
  border: 1px solid;
  border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white);
}

/* Content */
.content-header {
  background: var(--win-blue);
  color: white;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.content-header h1 { font-size: 16px; font-weight: bold; }
.content-body { padding: 12px 14px; }

.section-title {
  font-weight: bold;
  font-size: 12px;
  color: var(--win-blue);
  border-bottom: 2px solid var(--win-blue);
  padding-bottom: 2px;
  margin-bottom: 8px;
  margin-top: 14px;
}
.section-title:first-child { margin-top: 0; }

p { font-size: 11px; line-height: 1.6; margin-bottom: 6px; }

.inset-box {
  background: var(--win-inset-bg);
  border: 1px solid;
  border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker);
  padding: 8px;
  margin-bottom: 8px;
  font-size: 11px;
}

.win-button {
  background: var(--win-face);
  border: 2px solid;
  border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white);
  padding: 4px 16px;
  font-family: inherit; font-size: 11px;
  cursor: pointer; min-width: 75px;
}
.win-button:active { border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker); }
.win-button.default { outline: 1px solid black; outline-offset: -4px; }

/* Status bar */
.statusbar {
  display: flex; gap: 1px;
  padding: 2px 4px;
  border-top: 1px solid var(--win-dark);
  background: var(--win-face);
}
.statusbar-pane {
  font-size: 10px; padding: 1px 6px;
  border: 1px solid;
  border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker);
  flex: 1;
}

/* Taskbar */
#taskbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 30px;
  background: var(--win-face);
  border-top: 2px solid var(--win-white);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  z-index: 9999;
}
#start-btn {
  background: var(--win-face);
  border: 2px solid;
  border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white);
  padding: 2px 8px;
  font-family: inherit; font-size: 12px; font-weight: bold;
  cursor: pointer;
  display: flex; align-items: center; gap: 4px; height: 22px;
}
#start-btn:active { border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker); }
.taskbar-separator { width: 2px; height: 22px; border-left: 1px solid var(--win-dark); border-right: 1px solid var(--win-white); margin: 0 2px; }
.taskbar-btn {
  height: 22px; padding: 2px 8px;
  background: var(--win-face);
  border: 1px solid;
  border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker);
  font-family: inherit; font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  min-width: 120px;
}
.taskbar-btn.active { box-shadow: inset 1px 1px 0 var(--win-dark); }
.taskbar-clock {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid;
  border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker);
  font-size: 11px; height: 22px;
  display: flex; align-items: center;
}

/* Visitor counter */
.visitor-counter { display: inline-flex; gap: 2px; margin-top: 4px; }
.counter-digit {
  background: black; color: #ff0000;
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 20px; padding: 2px 5px;
  min-width: 20px; text-align: center;
}

/* Marquee box */
.marquee-box {
  background: var(--win-black);
  color: #00ff00;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 3px 6px;
  overflow: hidden; white-space: nowrap;
  margin: 6px 0;
}

/* Blink */
@keyframes blink { 0%,100%{opacity:1}50%{opacity:0} }
.blink { animation: blink 1s infinite; color: red; font-weight: bold; }

/* Form */
.win-form { display: flex; flex-direction: column; gap: 6px; }
.win-form label { font-size: 11px; }
.win-form input, .win-form textarea, .win-form select {
  font-family: inherit; font-size: 11px;
  background: white;
  border: 1px solid;
  border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker);
  padding: 2px 4px; outline: none; width: 100%;
}
.win-form textarea { resize: vertical; height: 60px; }

/* Progress bar */
.progress-bar-container {
  background: var(--win-inset-bg);
  border: 1px solid;
  border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker);
  height: 16px; overflow: hidden;
}
.progress-bar-fill { height: 100%; background: var(--win-blue); }

/* Checkbox / radio */
.win-check { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.win-check input { accent-color: var(--win-blue); }

/* Draggable windows */
.window { user-select: none; }

/* ═══════════════════════════════════════════════
   OVERRIDES DARK — éléments page-spécifiques
═══════════════════════════════════════════════ */

/* Tables */
html.dark .win-table th { background: var(--win-face); color: var(--win-text); border-color: var(--win-dark); }
html.dark .win-table td { border-color: var(--win-dark); color: var(--win-text); background: var(--win-main-bg); }
html.dark .win-table tr:hover td { background: var(--win-blue); color: #000; }

/* Tabs */
html.dark .tab-bar { border-bottom-color: var(--win-dark); }
html.dark .tab { background: var(--win-face); color: var(--win-text); border-color: var(--win-dark); }
html.dark .tab.active { background: var(--win-main-bg); color: var(--win-blue); border-bottom-color: var(--win-main-bg); }
html.dark .tab-content { background: var(--win-main-bg); color: var(--win-text); }
html.dark .tab-content.active { display: block; }

/* Gallery */
html.dark .gallery-item { background: var(--win-face); border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white); }
html.dark .photo-caption { background: var(--win-face); color: var(--win-text); border-top-color: var(--win-dark); }
html.dark .gallery-toolbar { background: var(--win-face); border-bottom-color: var(--win-dark); color: var(--win-text); }
html.dark .view-btn { background: var(--win-face); color: var(--win-text); }
html.dark .view-btn.active { border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker); }
html.dark .list-header { background: var(--win-face); color: var(--win-text); border-bottom-color: var(--win-dark); }
html.dark .list-item { color: var(--win-text); border-bottom-color: var(--win-dark); }
html.dark .list-item:hover { background: var(--win-blue); color: #000; }
html.dark .list-item:hover .list-col.sm { color: #001a33; }
html.dark .list-col.sm { color: var(--win-text-muted); }
html.dark .lightbox-window { background: var(--win-face); border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white); box-shadow: 2px 2px 0 #000; }
html.dark .lightbox-info { border-top-color: var(--win-dark); color: var(--win-text); }
html.dark .lightbox-meta { color: var(--win-text-muted); }
html.dark .lightbox-nav { border-top-color: var(--win-dark); }
html.dark select { background: var(--win-inset-bg); color: var(--win-text); border-color: var(--win-dark); }

/* À propos */
html.dark .profile-card { background: var(--win-main-bg); border-bottom-color: var(--win-dark); color: var(--win-text); }
html.dark .profile-name { color: var(--win-blue); }
html.dark .profile-handle { color: var(--win-text-muted); }
html.dark .about-section { background: var(--win-main-bg); border-bottom-color: var(--win-dark); }
html.dark .specs-table td { border-color: var(--win-dark); color: var(--win-text); }
html.dark .specs-table td:first-child { background: var(--win-face); }
html.dark .timeline-item { border-left-color: var(--win-blue); color: var(--win-text); }
html.dark .timeline-item::before { background: var(--win-blue); }
html.dark .timeline-year { color: var(--win-blue); }
html.dark .interest-card { background: var(--win-face); color: var(--win-text); border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white); }
html.dark .interest-card:hover { background: var(--win-blue); color: #000; }
html.dark .faq-question { background: var(--win-face); color: var(--win-text); }
html.dark .faq-question:hover { background: var(--win-blue); color: #000; }
html.dark .faq-item { border-bottom-color: var(--win-dark); }
html.dark .faq-answer { background: var(--win-main-bg); color: var(--win-text); }
html.dark .guestbook-entry { background: var(--win-main-bg); border-color: var(--win-dark); color: var(--win-text); }
html.dark .entry-author { color: var(--win-blue); }
html.dark .entry-date { color: var(--win-text-muted); }
html.dark .star-rating { text-shadow: 0 0 4px rgba(255,215,0,0.5); }

/* ── Bouton sélecteur de langue ─────────────────── */
#lang-toggle {
  height: 22px;
  padding: 0 8px;
  background: var(--win-face);
  border: 1px solid;
  border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white);
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--win-text);
  white-space: nowrap;
  transition: all 0.2s ease;
}
#lang-toggle:hover {
  background: var(--win-blue);
  color: white;
}
#lang-toggle:active {
  border-color: var(--win-darker) var(--win-white) var(--win-white) var(--win-darker);
}
html.dark #lang-toggle {
  background: var(--win-face);
  color: var(--win-text);
  
}
html.dark #lang-toggle:hover {
  background: var(--win-blue);
  color: #000;
}

/* ═══════════════════════════════════════════════
   FOND D'ÉCRAN + FENÊTRE DE CRÉDIT
═══════════════════════════════════════════════ */

/* Chemin depuis /pages/ (utilisé par galerie, apropos, modding) */
body {
  background-image: url('../img/wallpaper.jpg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Overlay très léger pour garder la lisibilité des icônes */
#desktop::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.08);
  pointer-events: none;
  z-index: 0;
}

/* En mode sombre : overlay un peu plus prononcé */
html.dark #desktop::before {
  background: rgba(0, 0, 10, 0.45);
}

/* ── Fenêtre de crédit photo — fixe, ne bouge pas ── */
#photo-credit {
  position: fixed;
  bottom: 38px;
  right: 10px;
  z-index: 500;
  animation: slideIn 0.3s ease-out;
  /* Pas de draggable : cursor par défaut */
}

.credit-window {
  background: var(--win-face);
  border: 2px solid;
  border-color: var(--win-white) var(--win-darker) var(--win-darker) var(--win-white);
  box-shadow: 2px 2px 0 #000;
  min-width: 200px;
}

.credit-titlebar {
  background: var(--win-title-active);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 4px;
  font-size: 11px;
  font-weight: bold;
  gap: 6px;
  cursor: default;
  user-select: none;
}

.credit-body {
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.6;
}

.credit-body .credit-icon {
  font-size: 18px;
  float: left;
  margin-right: 6px;
  margin-top: 1px;
}

.credit-author {
  font-weight: bold;
  color: var(--win-blue);
}

.credit-location {
  color: var(--win-darker);
  font-size: 10px;
}

html.dark .credit-body { color: var(--win-text); }
html.dark .credit-author { color: var(--win-blue); }
html.dark .credit-location { color: var(--win-text-muted); }

#photo-credit .win-btn {
  width: 14px; height: 12px; font-size: 8px;
}
