/* ================================================================
   PRODUCTION OVERRIDES — strips mockup chrome, enables real layout
   ================================================================ */

/* --- Reset mockup page background --- */
body {
  background: var(--bg);
  padding: 0;
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Full-viewport screens --- */
.screen {
  width: 100%;
  min-height: 100vh;
  height: auto;
  border-radius: 0;
  overflow: visible;
  max-width: 480px;
  margin: 0 auto;
}

/* Login screen needs full-height flex */
.login-screen {
  min-height: 100vh;
  background: linear-gradient(155deg, #FAF7F2 0%, #EFE5CC 55%, #E2CDA0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px env(safe-area-inset-bottom);
  position: relative;
  overflow: hidden;
}

/* --- Hide all mockup chrome --- */
.status-bar,
.mockup-header,
.screen-label,
.device-frame,
.desktop-frame,
.browser-chrome,
.polish-grid,
.polish-card,
.polish-label {
  display: none !important;
}

/* --- Screen body — no overflow hidden in production --- */
.screen-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
  min-height: calc(100vh - 80px);
}

/* --- Scroll area becomes natural flow --- */
.scroll-area {
  flex: 1;
  overflow: visible;
  padding-bottom: 8px;
}

/* --- Bottom nav: fixed at bottom --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* --- Content must clear fixed bottom nav --- */
.app-content {
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

/* --- Real input elements get same styles as .input divs --- */
input.input,
select.input,
textarea.input {
  display: block;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
input.input:focus,
select.input:focus,
textarea.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, .08);
}
input.input::placeholder {
  color: var(--ink-muted);
  opacity: 1;
}
textarea.input {
  height: auto;
  min-height: 80px;
  resize: none;
}

/* --- Offline banner --- */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #FFFBEB;
  border-bottom: 1px solid #FDE68A;
  color: #92400E;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.offline-banner[hidden] { display: none; }

/* --- Toast container --- */
#toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: 100%;
  max-width: 380px;
  padding: 0 16px;
}
#toast-container .toast {
  pointer-events: all;
  width: 100%;
  animation: toast-in 0.2s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast-exit {
  animation: toast-out 0.25s ease forwards !important;
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px); }
}

/* --- Modal container --- */
#modal-container {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
#modal-container:not(:empty) {
  pointer-events: all;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 35, 50, .45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-sheet {
  max-width: 480px;
  width: 100%;
}
.modal-body {
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  padding: 16px;
}

/* --- Upload progress bar --- */
.upload-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.upload-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.2s;
}

/* --- Confirm modal overlay --- */
.confirm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 35, 50, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* --- Loading spinner --- */
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* --- Hero wrap scroll fix --- */
.hero-wrap {
  flex-shrink: 0;
}

/* --- Fab on dashboard (not absolute, relative to bottom nav) --- */
.fab {
  position: fixed;
  bottom: calc(88px + env(safe-area-inset-bottom));
  right: calc(50% - 224px);
  z-index: 101;
}
@media (max-width: 480px) {
  .fab { right: 16px; }
}

/* --- Desktop: wider layout --- */
@media (min-width: 768px) {
  .screen { max-width: 480px; }
  .bottom-nav { max-width: 480px; }
  body { background: #E8E2DA; }
}

/* --- Prevent text selection on interactive elements --- */
.btn, .chip, .nav-item, .nav-fab, .tab-item { user-select: none; }

/* --- Active button state --- */
.btn:active { transform: scale(.97); }
.btn-primary:active { background: var(--primary); }

/* ================================================================
   TRIP DETAIL — HERO
   ================================================================ */

/* Hero back/edit buttons: no status-bar offset in production */
.hero-back { top: 16px !important; }
.hero-edit  { top: 16px !important; }

/* Hero wrap: fluid height in production */
.hero-wrap {
  height: 40vh !important;
  min-height: 280px;
}

/* Sticky tab-nav: no shadow from mockup, custom in prod */
#trip-sticky {
  box-shadow: 0 2px 8px rgba(26,35,50,.06);
}

/* Tab content padding accounts for fixed bottom nav */
#trip-tab-content {
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

/* c-danger missing from main.css */
.c-danger { color: var(--danger); }

/* Warning soft bg for offline banner */
--warning-soft: #FFFBEB;

/* Pull-to-refresh spinner */
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* Desktop: toast top-right instead of top-center */
@media (min-width: 500px) {
  #toast-container {
    left: auto;
    right: 16px;
    transform: none;
    align-items: flex-end;
  }
}
