/**
 * edenphonesim — styles du châssis smartphone
 *
 * Rendu propre multi-device. Chaque preset configure via CSS vars
 * --sim-w, --sim-h, --sim-r, --sim-vw, --sim-vh.
 */

.eps-wrap {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #1a1f2e 0%, #0a0d14 70%);
  color: #cdd6f4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
}
.eps-wrap.eps-theme-light {
  background: radial-gradient(circle at 30% 20%, #e6e9ef 0%, #ccd0da 70%);
  color: #4c4f69;
}

/* ── Stage : conteneur de scaling centré ─────────────────────────────── */
.eps-stage {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}

/* ── Shell : châssis physique du téléphone ────────────────────────────── */
.eps-shell {
  position: relative;
  width: var(--sim-w); height: var(--sim-h);
  border-radius: var(--sim-r);
  /* Matière du téléphone : dégradé sombre avec brillance subtile */
  background: linear-gradient(145deg, #1a1a20 0%, #0c0c10 40%, #1a1a20 100%);
  box-shadow:
    0 0 0 2px #2a2a32,                     /* trait de jonction châssis */
    0 40px 80px rgba(0,0,0,0.55),          /* ombre projetée */
    0 15px 40px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.08);  /* highlight top */
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center center;
  flex-shrink: 0;
}

/* ── Screen : écran intérieur ─────────────────────────────────────────── */
.eps-screen {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: var(--sim-vw); height: var(--sim-vh);
  border-radius: calc(var(--sim-r) - 6px);
  overflow: hidden;
  background: #000;
  /* Léger reflet de verre */
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ── Notch / punch-hole / dynamic island ──────────────────────────────── */
.eps-notch {
  position: absolute; z-index: 10;
  background: #000;
  pointer-events: none;
}
.eps-notch-punch-hole {
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.eps-notch-dynamic-island {
  background: #050505;
  box-shadow:
    0 0 8px rgba(0,0,0,0.6),
    inset 0 0 0 1px rgba(255,255,255,0.1);
}
.eps-notch-teardrop {
  border-radius: 0 0 50% 50%;
  background: #000;
}

/* ── Status bar ───────────────────────────────────────────────────────── */
.eps-statusbar {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  font-size: 13px; font-weight: 600;
  color: #fff;
  pointer-events: none;
}
.eps-statusbar-ios {
  padding: 0 28px;
  font-size: 14px;
}
.eps-sb-time {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}
.eps-sb-right {
  display: inline-flex; align-items: center; gap: 6px;
}
.eps-sb-signal, .eps-sb-wifi, .eps-sb-battery {
  display: inline-flex; align-items: center;
  color: #fff;
}

/* iOS : time à gauche collé à l'angle, right à droite, evite le notch */
.eps-statusbar-ios .eps-sb-time { padding-left: 8px; }
.eps-statusbar-ios .eps-sb-right { padding-right: 8px; }

/* ── Viewport (iframe) ────────────────────────────────────────────────── */
.eps-viewport {
  position: absolute; left: 0; right: 0;
  overflow: hidden;
  background: #fff;
}
.eps-iframe {
  width: 100%; height: 100%;
  border: none; background: #fff;
  display: block;
}
.eps-iframe-bare {
  position: absolute; inset: 0;
  border-radius: 0;
}

/* ── Nav bar (Android 3 buttons) ───────────────────────────────────────── */
.eps-navbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-around;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: #fff;
}
.eps-nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 100%;
  background: none; border: none; color: inherit; cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.1s ease, background 0.1s ease;
}
.eps-nav-btn:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.eps-nav-btn:active { background: rgba(255,255,255,0.15); }

/* ── Home indicator iOS ─────────────────────────────────────────────── */
.eps-navbar-home-indicator {
  background: transparent;
  pointer-events: none;
}
.eps-home-indicator {
  width: 134px; height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.85);
  margin: auto;
}

/* ── Boutons latéraux (power, volume, mute) ─────────────────────────── */
.eps-side-btn {
  position: absolute;
  width: 3px;
  background: linear-gradient(90deg, #0a0a0c 0%, #1a1a20 50%, #0a0a0c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 1px 2px rgba(0,0,0,0.3);
  border-radius: 1px;
}
.eps-side-left { left: -3px; }
.eps-side-right { right: -3px; }
/* Bouton mute (iPhone) : switch crénelé plutôt que lisse */
.eps-btn-mute {
  background: linear-gradient(90deg, #2a2a30, #1a1a20);
  width: 4px;
  left: -4px;
}

/* ── Rotation landscape : le container orient change, on fait pivoter le shell ── */
.eps-wrap[data-orientation="landscape"] .eps-shell {
  /* le scaling + rotate(-90deg) est appliqué en JS dans updateScale */
}

/* ── Mode desktop (pas de châssis) ───────────────────────────────────── */
.eps-wrap[data-type="desktop"] {
  background: #0a0d14;
}

/* ── Responsive hints ────────────────────────────────────────────────── */
@media (max-width: 500px) {
  .eps-shell { box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
}

/* ── Intent popup "Ouvrir avec…" ──────────────────────────────────── */
.eps-intent-popup {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0; pointer-events: auto;
  animation: eps-intent-fade 0.15s ease-out;
}
@keyframes eps-intent-fade { from { opacity: 0; } to { opacity: 1; } }
.eps-intent-dialog {
  background: #1e1e2e; color: #cdd6f4;
  width: 90%; max-width: 340px;
  margin-bottom: 12%;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
  overflow: hidden;
  animation: eps-intent-slide 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes eps-intent-slide {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.eps-intent-head {
  padding: 16px 18px 8px;
  font-size: 14px; font-weight: 700;
  color: #cdd6f4;
}
.eps-intent-body {
  padding: 0 18px 14px;
  font-size: 11px;
  color: #a6adc8;
}
.eps-intent-body code {
  display: block;
  font-family: var(--font-mono, monospace);
  word-break: break-all;
  background: rgba(255,255,255,0.04);
  padding: 8px 10px;
  border-radius: 6px;
}
.eps-intent-actions {
  display: flex;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.eps-intent-actions button {
  flex: 1;
  background: none; border: none;
  color: #89b4fa;
  padding: 12px 0;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background 0.1s ease;
}
.eps-intent-actions button:hover { background: rgba(137,180,250,0.08); }
.eps-intent-actions .eps-intent-cancel { color: #a6adc8; border-right: 1px solid rgba(255,255,255,0.06); }

/* ── Side buttons en landscape : bandes horizontales top/bottom ────── */
.eps-side-top    { top:    -3px; background: linear-gradient(180deg, #0a0a0c 0%, #1a1a20 50%, #0a0a0c 100%); }
.eps-side-bottom { bottom: -3px; background: linear-gradient(180deg, #0a0a0c 0%, #1a1a20 50%, #0a0a0c 100%); }
