/* Plugin: phonesim-launcher — fenêtre flottante pour edenphonesim
   Refonte UX : pas de wrapper window. Le device flotte tel quel ; une
   toolbar verticale glassy se colle à son flanc gauche (pastilles macOS,
   actions API, label vertical). Drag par bezel du device ou par la vbar. */

.sim-float-window {
  position: fixed;
  display: flex;
  align-items: stretch;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  font-family: var(--font-ui);
  color: var(--fg);
  animation: sim-win-in 0.25s ease-out;
  gap: 6px;
}
@keyframes sim-win-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* En plein écran on remet un fond pour ne pas voir à travers */
.sim-float-window.sim-maximized {
  background: rgba(8, 14, 28, 0.96);
  border-radius: 0;
}

/* ── Toolbar verticale collée au flanc gauche du device ─────────────── */
.sim-float-vbar {
  flex-shrink: 0;
  width: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  background: rgba(8, 14, 28, 0.94);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-lg);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.45),
    0 0 18px rgba(88, 200, 255, 0.14);
  cursor: grab;
  user-select: none;
}
.sim-float-vbar:active { cursor: grabbing; }

.sim-vbar-tlights {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
}

.sim-vbar-sep {
  width: 18px;
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 10px 0 8px 0;
}

.sim-vbar-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.sim-vbar-spacer { flex: 1; min-height: 8px; }

/* Label vertical : nom projet + device, écrit haut→bas. */
.sim-vbar-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg); /* pour lire bas→haut, plus naturel */
  max-height: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 0;
  opacity: 0.7;
}

/* Boutons API (refresh, orient, shake, geo) */
.sim-tb-btn {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 24px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-dim);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.sim-tb-btn:hover {
  background: rgba(88,200,255,0.10);
  color: var(--esh-accent, #58c8ff);
  border-color: rgba(88,200,255,0.30);
}

/* ── Picker GPS (popup ancrée au bouton 📍) ────────────────────────── */
.sim-geo-picker {
  position: fixed;
  z-index: 9500;
  width: 280px;
  background: rgba(12, 18, 32, 0.97);
  border: 1px solid rgba(88, 200, 255, 0.30);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55);
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
}
.sim-geo-head {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 8px;
}
.sim-geo-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 8px;
}
.sim-geo-preset {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--fg);
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  text-align: left;
  transition: background .15s ease, border-color .15s ease;
}
.sim-geo-preset:hover { background: rgba(88,200,255,0.10); border-color: rgba(88,200,255,0.30); }
.sim-geo-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
.sim-geo-row input {
  flex: 1;
  min-width: 0;
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--fg);
  font-family: inherit;
  font-size: 11px;
  padding: 5px 6px;
  border-radius: 3px;
  outline: none;
}
.sim-geo-row input:focus { border-color: var(--esh-accent, #58c8ff); }
.sim-geo-apply {
  background: rgba(88,200,255,0.20);
  border: 1px solid rgba(88,200,255,0.40);
  color: var(--fg);
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
}
.sim-geo-apply:hover { background: rgba(88,200,255,0.30); }

/* ── Zone du device (à droite de la vbar) ───────────────────────────── */
.sim-float-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

/* Override du wrapper EdenPhoneSim quand on est en mode flottant : son
   .eps-wrap peint un gradient gris destiné au mode embedded plein pane.
   Ici on veut que le device flotte dans le vide — pas de cadre derrière. */
.sim-float-window .eps-wrap { background: transparent !important; }

.sim-float-window.sim-maximized .ec-resize { display: none; }

/* ── Variante landscape : vbar horizontale en haut ─────────────────── */
.sim-float-window.sim-orient-landscape {
  flex-direction: column;
}
.sim-float-window.sim-orient-landscape .sim-float-vbar {
  width: 100%;
  height: 36px;
  flex-direction: row;
  align-items: center;
  padding: 0 8px;
}
.sim-float-window.sim-orient-landscape .sim-vbar-tlights {
  flex-direction: row;
  padding-top: 0;
  padding-left: 2px;
  gap: 6px;
}
.sim-float-window.sim-orient-landscape .sim-vbar-sep {
  width: 1px;
  height: 18px;
  margin: 0 8px;
}
.sim-float-window.sim-orient-landscape .sim-vbar-actions {
  flex-direction: row;
  gap: 4px;
}
.sim-float-window.sim-orient-landscape .sim-vbar-spacer {
  flex: 1;
  min-width: 8px;
  min-height: 0;
}
.sim-float-window.sim-orient-landscape .sim-vbar-label {
  writing-mode: horizontal-tb;
  text-orientation: initial;
  transform: none;
  padding: 0 4px;
  max-height: none;
  max-width: 220px;
}
