/* =============================================================
   BALENA ETCHER — SIMULATEUR CSS
   TechEnClair © 2026 — etcher-simulator.css
   ============================================================= */

/* ── WRAPPER GLOBAL ─────────────────────────────────────────── */
#etcher-simulator-host {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 40px 120px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.03);
  position: relative;
  user-select: none;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ── BARRE DES TÂCHES ────────────────────────────────────────── */
.etch-taskbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1a1a2e;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  height: 42px;
  padding: 0 8px;
  position: relative;
  z-index: 100;
}

.etch-taskbar-left,
.etch-taskbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.etch-start-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: transparent;
  border: none;
  color: #e0e0e0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
.etch-start-btn:hover { background: rgba(255,255,255,0.1); }

.etch-taskbar-divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.1);
  margin: 0 4px;
}

.etch-taskbar-app {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #999;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  transition: all 0.15s;
}
.etch-taskbar-app:hover { background: rgba(255,255,255,0.1); color: #fff; }
.etch-taskbar-app.active { color: #fff; border-bottom-color: #e44d90; background: rgba(228, 77, 144, 0.1); }

.etch-taskbar-app-icon { font-size: 14px; }

.etch-usb-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.etch-usb-indicator.not-connected {
  color: #666;
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.07);
}
.etch-usb-indicator.not-connected:hover {
  background: rgba(255,255,255,0.1);
  color: #ccc;
}
.etch-usb-indicator.connected {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.3);
}
.etch-usb-indicator svg { flex-shrink: 0; }

.etch-clock {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  min-width: 36px;
  text-align: center;
}

/* ── BUREAU ──────────────────────────────────────────────────── */
.etch-desktop {
  background: linear-gradient(135deg, #0d1117 0%, #161b27 50%, #0d111c 100%);
  min-height: 420px;
  position: relative;
  overflow: hidden;
}

.etch-desktop::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(228, 77, 144, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

/* ── ICÔNE BUREAU ───────────────────────────────────────────── */
.etch-desktop-icon {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.15s;
  width: 72px;
}
.etch-desktop-icon:hover { background: rgba(255,255,255,0.08); }
.etch-desktop-icon.active .etch-desktop-icon-img { box-shadow: 0 0 0 2px #e44d90; }
.etch-desktop-icon-img {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #1a1a2e, #2a1a3e);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 1px solid rgba(255,255,255,0.08);
}
.etch-desktop-icon span {
  font-size: 10px;
  color: #ccc;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  line-height: 1.2;
}

/* ── NOTIFICATION USB ────────────────────────────────────────── */
.etch-usb-toast {
  position: absolute;
  bottom: 54px;
  right: 12px;
  background: #1e2130;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #ddd;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
  pointer-events: none;
  max-width: 260px;
}
.etch-usb-toast.show { opacity: 1; transform: translateX(0); }
.etch-toast-title { font-weight: 700; margin-bottom: 2px; }
.etch-toast-sub { font-size: 10px; color: #888; }

/* ── FENÊTRE ─────────────────────────────────────────────────── */
.etch-window {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 24px));
  background: #1a0a2e;
  border-radius: 10px;
  border: 1px solid rgba(228, 77, 144, 0.2);
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(228,77,144,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
  transition: box-shadow 0.2s;
}

.etch-window.etch-opening {
  animation: etchWindowOpen 0.25s ease-out;
}
.etch-window.etch-closing {
  animation: etchWindowClose 0.25s ease-in forwards;
}
.etch-window.etch-minimized {
  animation: etchWindowMin 0.25s ease-in forwards;
}
.etch-window.etch-maximized {
  position: absolute !important;
  top: 0 !important; left: 0 !important;
  right: 0 !important; bottom: 0 !important;
  width: 100% !important;
  border-radius: 0;
  transform: none !important;
}

@keyframes etchWindowOpen {
  from { opacity: 0; transform: translateX(-50%) scale(0.92); }
  to   { opacity: 1; transform: translateX(-50%) scale(1); }
}
@keyframes etchWindowClose {
  from { opacity: 1; transform: translateX(-50%) scale(1); }
  to   { opacity: 0; transform: translateX(-50%) scale(0.88); }
}
@keyframes etchWindowMin {
  from { opacity: 1; transform: translateX(-50%) scale(1); }
  to   { opacity: 0; transform: translateX(-50%) translateY(60px) scale(0.7); }
}

/* ── TITLEBAR ────────────────────────────────────────────────── */
.etch-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #140824, #1e0d38);
  padding: 0 12px;
  height: 38px;
  cursor: move;
  border-bottom: 1px solid rgba(228,77,144,0.15);
  flex-shrink: 0;
}
.etch-titlebar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.etch-titlebar-icon { font-size: 16px; }
.etch-titlebar-text {
  font-size: 12px;
  font-weight: 600;
  color: #ccc;
}
.etch-titlebar-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}
.etch-win-btn {
  width: 32px;
  height: 28px;
  border: none;
  background: transparent;
  color: #999;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.etch-win-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.etch-win-close:hover { background: #e74c3c !important; color: #fff !important; }

/* ── APP BODY ────────────────────────────────────────────────── */
.etch-app {
  background: linear-gradient(160deg, #0e0820 0%, #130a28 100%);
  flex: 1;
  position: relative;
  overflow: hidden;
}

.etch-screen {
  display: none;
  flex-direction: column;
  padding: 24px;
  min-height: 320px;
  justify-content: center;
  align-items: stretch;
}
.etch-screen.active { display: flex; }

/* ── SOURCE HINT ─────────────────────────────────────────────── */
.etch-source-hint {
  font-size: 10px;
  color: #555;
  text-align: center;
  margin-bottom: 20px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.04);
  transition: all 0.3s;
}

/* ── STEPS ROW ───────────────────────────────────────────────── */
.etch-steps-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.etch-step-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s;
  min-width: 130px;
  max-width: 160px;
  flex: 1;
  text-align: center;
}
.etch-step-block:hover:not(.disabled) {
  background: rgba(228, 77, 144, 0.08);
  border-color: rgba(228, 77, 144, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(228,77,144,0.12);
}
.etch-step-block.selected {
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.05);
}
.etch-step-block.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.etch-step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.15);
  color: #888;
  transition: all 0.2s;
}
.etch-step-number.active {
  background: rgba(228, 77, 144, 0.2);
  border-color: #e44d90;
  color: #e44d90;
}
.etch-step-number.done {
  background: rgba(74, 222, 128, 0.2);
  border-color: #4ade80;
  color: #4ade80;
}

.etch-step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0;
}
.etch-step-icon svg { color: #e44d90; }

.etch-step-title {
  font-size: 12px;
  font-weight: 700;
  color: #ddd;
}
.etch-highlight { color: #e44d90; }

.etch-step-sub {
  font-size: 10px;
  color: #666;
}

.etch-step-selected-file {
  font-size: 9px;
  color: #4ade80;
  word-break: break-all;
  text-align: center;
  max-width: 140px;
  line-height: 1.3;
}

.etch-arrow {
  font-size: 18px;
  color: rgba(255,255,255,0.15);
  flex-shrink: 0;
}

/* ── FLASH BUTTON ────────────────────────────────────────────── */
.etch-step-flash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 22px 28px;
  background: linear-gradient(135deg, #e44d90, #bd3877);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s;
  min-width: 100px;
  box-shadow: 0 8px 24px rgba(228, 77, 144, 0.3);
  color: white;
}
.etch-step-flash:hover:not(.disabled) {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 16px 40px rgba(228, 77, 144, 0.45);
  background: linear-gradient(135deg, #f06097, #e44d90);
}
.etch-step-flash.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
}
.etch-flash-lightning { font-size: 28px; }
.etch-flash-label { font-size: 13px; font-weight: 900; letter-spacing: 0.05em; }

/* ── MODAL ───────────────────────────────────────────────────── */
.etch-modal {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  backdrop-filter: blur(4px);
}
.etch-modal.show .etch-modal-box {
  animation: etchModalIn 0.2s ease-out;
}
.etch-modal {
  flex-direction: column;
}
.etch-modal > * { width: min(440px, 94%); }

@keyframes etchModalIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.etch-modal-header {
  background: #1e0d38;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #ddd;
  border-radius: 12px 12px 0 0;
  border: 1px solid rgba(228,77,144,0.2);
  border-bottom: none;
}
.etch-modal-close {
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
}
.etch-modal-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

.etch-modal-body {
  background: #0e0820;
  padding: 16px;
  border-left: 1px solid rgba(228,77,144,0.2);
  border-right: 1px solid rgba(228,77,144,0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.etch-modal-info {
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
}

.etch-modal-footer {
  background: #12082a;
  padding: 10px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-radius: 0 0 12px 12px;
  border: 1px solid rgba(228,77,144,0.2);
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── FILE ITEMS ──────────────────────────────────────────────── */
.etch-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.etch-file-item:hover {
  background: rgba(228, 77, 144, 0.08);
  border-color: rgba(228, 77, 144, 0.3);
}
.etch-file-icon { font-size: 22px; flex-shrink: 0; }
.etch-file-info { flex: 1; }
.etch-file-name {
  font-size: 11px;
  font-weight: 600;
  color: #ddd;
  word-break: break-all;
  line-height: 1.3;
}
.etch-file-meta {
  font-size: 10px;
  color: #666;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.etch-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid;
  text-transform: uppercase;
}
.etch-file-check {
  color: #4ade80;
  font-size: 16px;
  font-weight: 900;
  flex-shrink: 0;
}

/* ── URL SECTION ─────────────────────────────────────────────── */
.etch-url-section { margin-top: 8px; }
.etch-url-label {
  font-size: 10px;
  color: #555;
  text-align: center;
  margin-bottom: 8px;
}
.etch-url-row { display: flex; gap: 6px; }
.etch-url-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #ccc;
  font-size: 11px;
  font-family: monospace;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.2s;
}
.etch-url-input:focus { border-color: #e44d90; }
.etch-url-btn {
  background: #e44d90;
  border: none;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 0 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.etch-url-btn:hover { background: #f06097; }

/* ── DRIVE ITEMS ─────────────────────────────────────────────── */
.etch-drive-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.etch-drive-item:hover { background: rgba(228,77,144,0.08); border-color: rgba(228,77,144,0.3); }
.etch-drive-item.selected { border-color: #4ade80; background: rgba(74,222,128,0.06); }
.etch-drive-icon { font-size: 24px; flex-shrink: 0; }
.etch-drive-info { flex: 1; }
.etch-drive-name { font-size: 12px; font-weight: 700; color: #ddd; }
.etch-drive-detail { font-size: 10px; color: #666; margin-top: 2px; }
.etch-drive-size {
  font-size: 10px;
  font-weight: 700;
  color: #4ade80;
  margin-top: 2px;
}
.etch-drive-check { color: #4ade80; font-size: 16px; font-weight: 900; }

.etch-no-drive {
  text-align: center;
  padding: 24px;
  color: #666;
  font-size: 13px;
}

/* ── BOUTONS ─────────────────────────────────────────────────── */
.etch-btn-primary {
  background: #e44d90;
  border: none;
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}
.etch-btn-primary:hover { background: #f06097; }
.etch-btn-primary:disabled { opacity: 0.3; cursor: not-allowed; }

.etch-btn-secondary {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #aaa;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}
.etch-btn-secondary:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ── ÉCRAN FLASH ─────────────────────────────────────────────── */
.etch-flash-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 20px;
  min-height: 280px;
  justify-content: center;
  text-align: center;
}
.etch-flash-header {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}
.etch-flash-phase-icon { font-size: 28px; animation: etchPulse 1s ease-in-out infinite; }
.etch-flash-phase-label { font-size: 18px; font-weight: 800; color: #eee; }
.etch-flash-filename { font-size: 10px; color: #666; font-family: monospace; max-width: 400px; word-break: break-all; }

.etch-progress-wrap {
  width: 100%;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.etch-progress-bar-outer {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.etch-progress-bar-inner {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #e44d90, #f97316);
  transition: width 0.08s linear;
  box-shadow: 0 0 8px rgba(228,77,144,0.5);
}
.etch-progress-pct {
  font-size: 13px;
  font-weight: 900;
  color: #e44d90;
  min-width: 38px;
  text-align: right;
}
.etch-flash-rate { font-size: 11px; color: #666; }
.etch-flash-eta  { font-size: 10px; color: #555; }

@keyframes etchPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ── ÉCRAN DONE ──────────────────────────────────────────────── */
.etch-done-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 20px;
  text-align: center;
  animation: etchFadeIn 0.4s ease-out;
}
.etch-done-icon { font-size: 48px; }
.etch-done-title { font-size: 22px; font-weight: 900; color: #4ade80; }
.etch-done-sub { font-size: 13px; color: #aaa; }
.etch-done-hint {
  font-size: 11px;
  color: #666;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px 16px;
  max-width: 320px;
}

/* ── ÉCRAN ERREUR ────────────────────────────────────────────── */
.etch-error-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 20px;
  text-align: center;
}
.etch-error-icon { font-size: 48px; }
.etch-error-title { font-size: 22px; font-weight: 900; color: #f87171; }
.etch-error-sub { font-size: 13px; color: #aaa; }

/* ── ANIMATIONS GÉNÉRALES ────────────────────────────────────── */
@keyframes etchFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.etch-pulse-warn {
  animation: etchWarn 0.3s ease-in-out 2;
}
@keyframes etchWarn {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.6); }
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 500px) {
  .etch-steps-row { flex-direction: column; align-items: stretch; }
  .etch-arrow { transform: rotate(90deg); text-align: center; }
  .etch-step-block { max-width: 100%; flex-direction: row; min-height: 60px; }
  .etch-step-flash { flex-direction: row; }
}
