/**
 * RideSakhi — Mobile App Native Interface Styling
 * Driven by Women, For Women
 */

:root {
  --app-primary: #9C1D3F;
  --app-primary-dark: #7E1430;
  --app-accent: #E65100;
  --app-bg: #FCF8FA;
  --app-surface: #FFFFFF;
  --app-text: #1E252B;
  --app-muted: #64748B;
  --app-border: #F1DCE2;
  --app-bottom-nav-height: 68px;
}

body.mobile-app-body {
  background-color: #121518;
  color: var(--app-text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Mobile App Shell Container */
.app-device-frame {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  max-height: 940px;
  background-color: var(--app-bg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .app-device-frame {
    border-radius: 40px;
    height: 90vh;
    border: 8px solid #2A2E33;
  }
}

/* App Header */
.app-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 16px;
  border-bottom: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-brand img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.app-city-pill {
  background: #FFF0F5;
  color: var(--app-primary);
  border: 1px solid var(--app-border);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

.app-radar-badge {
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #C8E6C9;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.radar-dot {
  width: 7px;
  height: 7px;
  background: #2E7D32;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(46, 125, 50, 0.4);
  animation: radarPulse 1.8s infinite;
}

@keyframes radarPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(46, 125, 50, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

/* Interactive Map Viewport */
.app-map-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--app-bottom-nav-height);
  z-index: 1;
}

#appMap {
  width: 100%;
  height: 100%;
}

/* Floating GPS Button */
.app-gps-btn {
  position: absolute;
  right: 16px;
  top: 70px;
  z-index: 999;
  width: 44px;
  height: 44px;
  background: #FFFFFF;
  border: 1px solid var(--app-border);
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--app-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.app-gps-btn:active {
  transform: scale(0.92);
}

/* Bottom Action Sheet */
.app-bottom-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--app-bottom-nav-height);
  z-index: 990;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
  border-top: 1px solid var(--app-border);
  padding: 16px 20px 20px;
  max-height: 65vh;
  overflow-y: auto;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.sheet-drag-handle {
  width: 36px;
  height: 4px;
  background: #CBD5E1;
  border-radius: 4px;
  margin: 0 auto 12px;
}

/* Full Viewport App Content Tab Views */
.app-tab-view {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding-bottom: calc(var(--app-bottom-nav-height) + 20px);
  padding-top: 60px;
  background: var(--app-bg);
  position: relative;
  z-index: 10;
}

.app-tab-view.active-view {
  display: block;
}

/* Input Fields inside App */
.app-input-group {
  background: #F8FAFC;
  border: 1.5px solid var(--app-border);
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s ease;
}

.app-input-group:focus-within {
  border-color: var(--app-primary);
  background: #FFFFFF;
}

.app-input-group input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.9rem;
  color: var(--app-text);
  font-family: inherit;
}

/* Native App Bottom Navigation Dock */
.app-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--app-bottom-nav-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--app-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
}

.app-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--app-muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 12px;
  transition: all 0.2s ease;
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
}

.app-nav-item i {
  font-size: 1.25rem;
  margin-bottom: 3px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-nav-item.active-nav {
  color: var(--app-primary);
}

.app-nav-item.active-nav i {
  transform: translateY(-2px) scale(1.12);
  color: var(--app-primary);
}

/* SOS Floating Button inside Nav */
.app-nav-item.nav-sos {
  color: #D32F2F;
}

.app-nav-item.nav-sos i {
  color: #D32F2F;
  animation: sosIconPulse 2s infinite;
}

@keyframes sosIconPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Sakhi Duty Switcher Toggle */
.duty-switch-box {
  background: #FFFFFF;
  border: 1.5px solid var(--app-border);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.duty-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
}

.duty-indicator.online { background: #2E7D32; box-shadow: 0 0 10px #4CAF50; }
.duty-indicator.offline { background: #94A3B8; }

/* 1-Tap SOS Shield Screen Overlay */
.sos-overlay-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--app-bottom-nav-height);
  background: radial-gradient(circle at center, #7E1430 0%, #3B0613 100%);
  color: #FFFFFF;
  z-index: 1001;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}

.sos-overlay-screen.active-sos {
  display: flex;
}

.sos-trigger-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: #FF1744;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  box-shadow: 0 0 0 15px rgba(255, 23, 68, 0.3), 0 0 0 30px rgba(255, 23, 68, 0.15);
  cursor: pointer;
  border: none;
  animation: sosBigPulse 1.5s infinite;
  margin: 30px 0;
}

@keyframes sosBigPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 23, 68, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 25px rgba(255, 23, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 23, 68, 0); }
}

/* Install PWA Prompt Banner */
.pwa-install-banner {
  position: absolute;
  top: 60px;
  left: 12px;
  right: 12px;
  z-index: 995;
  background: #FFFFFF;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
