/* ===== APP SHELL ===== */
.app {
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  display: none;
  flex-direction: column;
  background: var(--bg-page);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.1);
}
.app.visible {
  display: flex;
}


/* ===== HEADER ===== */
.header {
  background: var(--white);
  color: var(--gray-800);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-height);
  flex-shrink: 0;
  z-index: 100;
  border-bottom: 1px solid var(--gray-200);
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.header-logo svg { width: 28px; height: 28px; flex-shrink: 0; }
.header-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--gray-800);
}
.header-city-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--bg-page);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  border: none;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.header-city-selector svg { width: 14px; height: 14px; color: var(--gray-500); }
.header-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-page);
  border-radius: var(--radius-full);
  padding: 7px 12px;
  min-width: 0;
}
.header-search svg { width: 16px; height: 16px; color: var(--gray-400); flex-shrink: 0; }
.header-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  font-family: inherit;
  color: var(--gray-700);
  background: transparent;
  min-width: 0;
}
.header-search input::placeholder { color: var(--gray-400); }
.header-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
}
.header-icon-btn:hover { background: var(--bg-page); }
.header-icon-btn svg { width: 20px; height: 20px; }


/* ===== TAB CONTENT ===== */
.tab-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.tab-panel {
  display: none;
  padding-bottom: 20px;
  min-height: 100%;
}
.tab-panel.active { display: block; }


/* ===== BOTTOM TABS ===== */
.bottom-tabs {
  display: flex;
  background: var(--white);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
  height: var(--tab-height);
  flex-shrink: 0;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
  position: relative;
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: color var(--transition);
  padding: 4px 0;
  position: relative;
}
.tab-btn svg { width: 22px; height: 22px; transition: transform var(--transition); }
.tab-btn.active { color: var(--orange-accent); }
.tab-btn.active svg { transform: scale(1.1); }
.tab-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 32px;
  height: 3px;
  background: var(--orange-accent);
  border-radius: 0 0 3px 3px;
  transition: transform var(--transition);
}
.tab-btn.active::after { transform: translateX(-50%) scaleX(1); }
/* Elevated center create button */
.tab-btn.tab-create {
  position: relative;
}
.tab-btn.tab-create .tab-create-circle {
  width: 52px;
  height: 52px;
  background: var(--orange-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -28px;
  box-shadow: 0 4px 12px rgba(255,107,0,0.35);
  transition: background var(--transition), transform var(--transition);
}
.tab-btn.tab-create .tab-create-circle svg {
  width: 26px;
  height: 26px;
  color: var(--white);
  stroke-width: 2.5;
}
.tab-btn.tab-create:hover .tab-create-circle { background: var(--orange-accent-dark); transform: scale(1.05); }
.tab-btn.tab-create.active { color: var(--orange-accent); }
.tab-btn.tab-create.active::after { display: none; }
.tab-btn.tab-create span.tab-label { margin-top: 2px; }


/* ===== PAGE OVERLAY (slide-from-right pages) ===== */
.page-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 550;
  pointer-events: none;
  visibility: hidden;
}
.page-overlay.open {
  pointer-events: auto;
  visibility: visible;
}
.page-overlay .page-container {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 100%;
  max-width: 480px;
  left: 50%;
  transform: translateX(calc(-50% + 100%));
  background: var(--bg-page);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: -4px 0 30px rgba(0,0,0,0.15);
}
.page-overlay.open .page-container {
  transform: translateX(-50%);
}

/* Page back button */
.page-back-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 10;
}
.page-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  font-family: inherit;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.page-back-btn:hover { background: var(--gray-50); }
.page-back-btn svg { width: 20px; height: 20px; }
.page-back-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ===== FOOTER ===== */
.app-footer {
  text-align: center;
  padding: 16px;
  font-size: 11px;
  color: var(--gray-400);
}
.app-footer a {
  color: var(--gray-400);
  text-decoration: none;
}
.app-footer a:hover { text-decoration: underline; }
