/* ═══════════════════════════════════════════════════════════
   IPHONE 16 PRO SIMULATOR
   Activates on desktop, disappears on actual mobile devices.
   ═══════════════════════════════════════════════════════════ */

/* Hide simulator by default (Native Mobile View) */
.iphone-simulator {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #000;
  margin: 0;
}

/* On Desktop: Show the Chassis */
@media (min-width: 500px) {
  /* Override the app's mobile-first overflow:hidden so the page can scroll
     if the chassis is taller than the viewport on short screens */
  html, body {
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body {
    background: #111;
  }

  .iphone-simulator {
    padding: 40px 0;
    min-height: 100vh;
    align-items: center;
  }

  .iphone-chassis {
    width: 393px;
    height: 852px;
    background: #000;
    border-radius: 55px;
    box-shadow:
      0 0 0 14px #1c1c1e,
      0 0 0 15px #3a3a3c,
      0 30px 60px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
    /* transform + margin-top/bottom are set by JS fit() in index.html.
       will-change: transform contains position:fixed children inside
       the chassis so overlays don't escape to the full browser window. */
    will-change: transform;
    flex-shrink: 0;
  }

  /* The actual app container inside the chassis */
  .iphone-screen {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50px;
    overflow: hidden;
    background: #000;
  }
}

/* On Mobile: Full screen, no chassis */
@media (max-width: 499px) {
  .iphone-simulator, 
  .iphone-chassis, 
  .iphone-screen {
    position: absolute;
    inset: 0;
    height: auto;
    width: auto;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }
}

/* ── Dynamic Island (Simulator Software Notch) ── */
.dynamic-island {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 35px;
  background: #000;
  border-radius: 20px;
  z-index: 999;
  box-shadow: inset 0 0 2px rgba(255,255,255,0.1);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  cursor: pointer;
  pointer-events: none; /* Only interactive when notification active */
}

/* Only show island on desktop or top notch devices if needed */
@media (max-width: 499px) {
  .dynamic-island {
    display: none; /* Real iPhones have hardware notches */
  }
}

.dynamic-island.expanded {
  width: 350px;
  height: 60px;
  border-radius: 30px;
  pointer-events: auto;
  /* Ultra Glassy Obsidian Marble Effect */
  background: rgba(10, 10, 15, 0.4);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.3),
    0 10px 40px rgba(0,0,0,0.8),
    0 0 20px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Island Content & Wisps */
.di-wisp {
  position: absolute; border-radius: 50%; filter: blur(6px); opacity: 0;
  transition: opacity 0.4s ease; pointer-events: none; z-index: -1;
}
.dynamic-island.expanded .di-wisp { opacity: 0.8; }
.di-wisp-1 {
  width: 60px; height: 60px; top: -10px; left: -10px;
  background: conic-gradient(from 0deg, #fff, rgba(255,255,255,0.1), #fff);
  animation: di-wisp-spin 3s linear infinite;
}
.di-wisp-2 {
  width: 80px; height: 50px; bottom: -15px; right: -20px;
  background: radial-gradient(circle, #fff, rgba(255,255,255,0));
  animation: di-wisp-spin 4s linear infinite reverse;
}

@keyframes di-wisp-spin {
  0% { transform: rotate(0deg) translate(5px) rotate(0deg); }
  100% { transform: rotate(360deg) translate(5px) rotate(-360deg); }
}

.di-content {
  opacity: 0; transform: scale(0.9); transition: all 0.3s ease;
  white-space: nowrap; pointer-events: none;
  display: flex; align-items: center; justify-content: center; width: 100%;
}
.dynamic-island.expanded .di-content {
  opacity: 1; transform: scale(1); transition-delay: 0.2s;
}

/* The chassis is scaled to fit any viewport by the fit() IIFE in index.html,
   which sets an inline `transform: scale(...)` directly on .iphone-chassis
   (only on desktop widths ≥500px — fit() early-returns on real mobile). */
