/* ============================================================
   REINDEER LAYOUT SYSTEM (MOBILE-FIRST APP SHELL)
   ============================================================ */

#app {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Map Canvas Container */
.map-canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

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

/* Top Navigation Chrome — matches fragment_home.xml:17-97 */
.app-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  padding: max(10px, env(safe-area-inset-top, 10px)) 16px 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  z-index: 10;
  pointer-events: none;
}
/* Brand area takes layout_weight="1" (flex:1) — matches fragment_home.xml:40-53 */
.topbar-brand-area {
  flex: 1;
  min-width: 0;
  pointer-events: none;
}
.topbar-circle-btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #FFFFFF;
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.1s;
  flex-shrink: 0;
  position: relative;
}
.topbar-circle-btn:active {
  transform: scale(0.94);
}
/* Brand text — matches android:textColor="#C5F228" shadowColor="#99000000" */
.topbar-brand-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--brand-lime);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

/* Floating Map Controls */
.map-floating-controls {
  position: absolute;
  right: 16px;
  bottom: calc(48vh + 20px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}
.map-float-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--rule-strong);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  font-size: 18px;
  transition: background-color 0.15s;
}
.map-float-btn:hover {
  background-color: var(--brand-lime);
}

/* App Bottom Sheet Container */
.bottom-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  background-color: var(--bg-surface);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  box-shadow: var(--shadow-floating);
  z-index: 20;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.sheet-handle-bar {
  width: 40px;
  height: 5px;
  background-color: var(--text-muted);
  border-radius: 999px;
  margin: 10px auto 4px;
  opacity: 0.35;
  cursor: grab;
}

.sheet-content {
  padding: 12px 18px max(24px, env(safe-area-inset-bottom, 24px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Fullscreen Overlay Pages (Auth, History, Profile) */
.page-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-app);
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: max(20px, env(safe-area-inset-top, 20px)) 20px max(24px, env(safe-area-inset-bottom, 24px));
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.overlay-title {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.overlay-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Desktop Responsiveness */
@media (min-width: 900px) {
  .bottom-sheet {
    position: absolute;
    top: 76px;
    left: 24px;
    bottom: 24px;
    right: auto;
    width: 440px;
    max-height: calc(100vh - 100px);
    border-radius: var(--radius-xl);
    border: 1.5px solid var(--rule);
  }
  .sheet-handle-bar {
    display: none;
  }
  .map-floating-controls {
    right: 24px;
    bottom: 30px;
  }
  .page-overlay {
    max-width: 500px;
    margin: 40px auto;
    border-radius: var(--radius-xl);
    border: 1.5px solid var(--rule);
    height: auto;
    max-height: 90vh;
    box-shadow: var(--shadow-floating);
  }
}

/* ── Side Drawer (matches fragment_home.xml:297-713) ─────────────────────── */
.drawer-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background-color: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: stretch;
}
/* Drawer panel: 300dp wide, background #FFF9E6 (matches fragment_home.xml:303) */
.drawer-panel {
  width: min(300px, 85vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(0);
  animation: drawerSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes drawerSlideIn {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
/* Drawer menu item row (matches each LinearLayout in ScrollView) */
.drawer-item {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 58px;
  padding: 0 20px;
  cursor: pointer;
  transition: background-color 0.12s;
  border: none;
  background: none;
  width: 100%;
}
.drawer-item:hover {
  background-color: rgba(17, 17, 17, 0.04);
}
.drawer-item:active {
  background-color: rgba(197, 242, 40, 0.15);
}
/* Separator between items (matches View dividers in fragment_home.xml) */
.drawer-item + .drawer-item {
  border-top: 1px solid #EDE5D4;
  margin-top: 0;
}
/* Drawer item text (matches android:textSize="15sp" textStyle="bold" #212121) */
.drawer-text {
  font-size: 15px;
  font-weight: 700;
  color: #212121;
  text-align: left;
}
.drawer-menu-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.drawer-menu-list::-webkit-scrollbar { display: none; }
