/* Mobile Simulator & Viewport Wrapper */

/* Lock viewport to device screen — critical for native rendering */
html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
}

#app-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0 25px 0;
  flex: 1;
}

/* In native mode, the container fills the full screen with no padding */
.mode-native ~ * #app-container,
body.is-native #app-container {
  padding: 0;
  height: 100%;
  align-items: stretch;
}

/* Base Device Container */
.device-wrapper {
  position: relative;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin: 0 auto;
}

/* Mobile Simulator Modes */
.device-wrapper.mode-iphone {
  width: 390px;
  height: 844px;
  background: #1c1c1e;
  border-radius: 50px;
  box-shadow: 
    0 0 0 10px #2c2c2e,
    0 0 0 12px #1c1c1e,
    0 25px 50px -12px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(0, 230, 118, 0.15);
  border: 4px solid #3a3a3c;
  overflow: hidden;
}

.device-wrapper.mode-android {
  width: 412px;
  height: 860px;
  background: #121212;
  border-radius: 40px;
  box-shadow: 
    0 0 0 8px #222222,
    0 0 0 10px #121212,
    0 25px 50px -12px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(0, 229, 255, 0.15);
  border: 3px solid #333;
  overflow: hidden;
}

.device-wrapper.mode-responsive {
  width: 100%;
  max-width: 1200px;
  height: calc(100vh - 75px);
  min-height: 550px;
  background: var(--bg-dark);
  border-radius: var(--radius-md);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

/* Native Device (Real Phone via Capacitor) */
.device-wrapper.mode-native {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  background: var(--bg-dark);
  border-radius: 0;
  box-shadow: none;
  border: none;
  margin: 0;
}

/* Dynamic Notch / Island */
.device-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
  transition: var(--transition-fast);
}

.mode-iphone .device-island {
  width: 120px;
  height: 30px;
  background: #000;
  border-radius: 20px;
  box-shadow: 0 0 1px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
}

.mode-iphone .device-island::after {
  content: '';
  width: 10px;
  height: 10px;
  background: #111e38;
  border-radius: 50%;
  border: 2px solid #080a10;
}

.mode-android .device-island {
  width: 14px;
  height: 14px;
  top: 14px;
  background: #000;
  border-radius: 50%;
  box-shadow: inset 0 0 2px #333;
}

.mode-responsive .device-island,
.mode-native .device-island {
  display: none;
}

/* Main App Shell inside Phone */
.app-screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  position: relative;
  overflow: hidden;
}

/* Top App Bar (iOS / Android Status & App Navigation) */
.mobile-top-bar {
  padding-top: 42px; /* Space for Notch */
  padding-left: 18px;
  padding-right: 18px;
  padding-bottom: 12px;
  background: rgba(13, 17, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}

.mode-responsive .mobile-top-bar {
  padding-top: 16px;
}

.mode-native .mobile-top-bar {
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: 12px;
}

.app-brand-mobile {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 230, 118, 0.15);
  border: 1px solid rgba(0, 230, 118, 0.4);
  color: var(--pitch-green);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

/* Main Content Area */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Bottom Navigation Bar */
.bottom-nav {
  min-height: 68px;
  height: auto;
  padding-top: 8px;
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: 8px;
  z-index: 30;
}

.mode-native .bottom-nav {
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  height: 100%;
  transition: var(--transition-fast);
  position: relative;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  transition: var(--transition-fast);
}

.nav-item.active {
  color: var(--pitch-green);
}

.nav-item.active svg {
  transform: translateY(-2px);
  stroke: var(--pitch-green);
  filter: drop-shadow(0 0 6px var(--pitch-green-glow));
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  width: 16px;
  height: 3px;
  background: var(--pitch-green);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--pitch-green);
}

/* Responsive adjustments for mobile web browsers */
@media (max-width: 600px) {
  #app-header {
    display: none !important;
  }

  #app-container {
    padding: 0 !important;
    height: 100% !important;
    width: 100% !important;
    align-items: stretch !important;
  }

  .device-wrapper,
  .device-wrapper.mode-iphone,
  .device-wrapper.mode-android,
  .device-wrapper.mode-responsive {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    background: var(--bg-dark) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
  }

  .device-island {
    display: none !important;
  }

  .mobile-top-bar {
    padding-top: max(12px, env(safe-area-inset-top)) !important;
    padding-bottom: 10px !important;
  }

  .bottom-nav {
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }
}

