/* ================================================================
   GeoHub — Mobile App Shell CSS
   Bottom nav, FAB, action sheet, notifications, install prompt,
   PWA splash, mobile UI polish.
   ================================================================ */

/* ── BODY SAFE PADDING ─────────────────────────────────────────── */
@media (max-width: 768px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
  }
  /* Reduce desktop heaviness */
  .section { padding: 36px 0 !important; }
  .section-header { margin-bottom: 20px !important; }
  a, button { -webkit-tap-highlight-color: transparent; }
  .btn { min-height: 42px; touch-action: manipulation; }
}

/* ── BOTTOM NAVIGATION ─────────────────────────────────────────── */
.app-bottom-nav {
  display: none;
}
@media (max-width: 768px) {
  .app-bottom-nav {
    display: grid;
    grid-template-columns: 1fr 1fr 72px 1fr 1fr;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 900;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(6, 8, 20, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    align-items: center;
  }
}
.app-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: #4b5563;
  transition: color 0.2s ease;
  padding: 8px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.app-nav-item i {
  font-size: 1.18rem;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), color 0.2s;
}
.app-nav-item span {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.app-nav-item.active { color: #10b981; }
.app-nav-item.active i { transform: scale(1.12); }
.app-nav-item:active i { transform: scale(0.88); }
.app-nav-item.live-item.active { color: #f87171; }

/* Live pulse indicator */
.nav-live-dot {
  display: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239,68,68,0.7);
  animation: navLivePulse 1.6s infinite;
  margin-bottom: 2px;
}
@keyframes navLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}
@media (max-width: 768px) { .nav-live-dot { display: block; } }

/* Notification badge on nav items */
.app-nav-badge {
  position: absolute;
  top: 4px; right: calc(50% - 18px);
  width: 17px; height: 17px;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  font-size: 0.6rem;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #060814;
}
.app-nav-item { position: relative; }

/* ── FAB ───────────────────────────────────────────────────────── */
.app-fab-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.app-fab {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  color: white;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem;
  box-shadow:
    0 4px 20px rgba(16,185,129,0.45),
    0 0 0 3px rgba(6,8,20,0.95),
    0 0 0 4px rgba(16,185,129,0.18);
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  margin-top: -28px;
  position: relative;
  z-index: 901;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}
.app-fab:active { transform: scale(0.9); }
.app-fab.open {
  transform: rotate(45deg) scale(1.05);
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow:
    0 4px 24px rgba(239,68,68,0.5),
    0 0 0 3px rgba(6,8,20,0.95),
    0 0 0 4px rgba(239,68,68,0.2);
}

/* ── ACTION SHEET ──────────────────────────────────────────────── */
.app-action-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: overlayFadeIn 0.2s ease;
}
.app-action-overlay.open { display: block; }
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.app-action-sheet {
  position: fixed;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  left: 12px; right: 12px;
  z-index: 960;
  border-radius: 18px;
  background: rgba(15, 20, 34, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 8px;
  transform: translateY(24px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.32s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 -8px 48px rgba(0,0,0,0.7);
}
.app-action-sheet.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}
.app-action-sheet-handle {
  width: 36px; height: 4px;
  border-radius: 99px;
  background: rgba(255,255,255,0.12);
  margin: 4px auto 10px;
}
.app-action-sheet-title {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #4b5563;
  padding: 0 16px 8px;
}
.app-action-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.app-action-item:hover,
.app-action-item:active { background: rgba(255,255,255,0.06); }
.app-action-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.app-action-text h4 { font-size: 0.92rem; font-weight: 700; margin-bottom: 2px; }
.app-action-text p  { font-size: 0.74rem; color: #4b5563; }
.app-action-chevron {
  margin-left: auto;
  color: #2a3d58;
  font-size: 0.76rem;
}

/* ── INSTALL PROMPT ────────────────────────────────────────────── */
.app-install-prompt {
  display: none;
  position: fixed;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  left: 12px; right: 12px;
  z-index: 880;
  border-radius: 16px;
  background: rgba(15, 20, 34, 0.97);
  border: 1px solid rgba(16,185,129,0.28);
  padding: 14px 16px;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(16,185,129,0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.app-install-prompt.visible {
  display: flex;
  animation: slideUpPrompt 0.38s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes slideUpPrompt {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.install-icon {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.92rem; font-weight: 900; color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(16,185,129,0.35);
}
.install-text { flex: 1; min-width: 0; }
.install-text strong { display: block; font-size: 0.88rem; font-weight: 800; }
.install-text span   { display: block; font-size: 0.72rem; color: #94a3b8; margin-top: 2px; }
.install-actions { display: flex; gap: 7px; flex-shrink: 0; }
.install-later {
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.install-later:hover { background: rgba(255,255,255,0.1); }
.install-now {
  padding: 8px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  border: none;
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 10px rgba(16,185,129,0.3);
}
.install-now:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(16,185,129,0.4); }

/* ── NOTIFICATION TOAST ────────────────────────────────────────── */
.app-notif-toast {
  position: fixed;
  top: 72px;
  left: 12px; right: 12px;
  z-index: 1100;
  border-radius: 14px;
  background: rgba(15, 20, 34, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateY(-16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
  cursor: pointer;
}
.app-notif-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}
.notif-icon-wrap {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.notif-body { flex: 1; min-width: 0; }
.notif-body strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-body span {
  display: block;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-time { font-size: 0.65rem; color: #4b5563; flex-shrink: 0; }
.notif-close {
  background: none;
  border: none;
  color: #4b5563;
  cursor: pointer;
  font-size: 0.82rem;
  padding: 4px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s;
}
.notif-close:hover { color: #94a3b8; }

/* ── SPLASH SCREEN ─────────────────────────────────────────────── */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #04050d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity 0.4s ease;
}
.splash-logo {
  width: 84px; height: 84px;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 900; color: white;
  box-shadow: 0 0 60px rgba(16,185,129,0.4);
  animation: splashGlow 2s ease-in-out infinite alternate;
}
@keyframes splashGlow {
  from { box-shadow: 0 0 40px rgba(16,185,129,0.35); }
  to   { box-shadow: 0 0 80px rgba(59,130,246,0.45); }
}
.splash-name {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.splash-name span { color: #10b981; }
.splash-tagline {
  font-size: 0.82rem;
  color: #4b5563;
  letter-spacing: 0.5px;
}
.splash-loader {
  width: 110px; height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}
.splash-loader-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  border-radius: 99px;
  width: 0%;
  animation: splashLoad 1.1s ease forwards;
}
@keyframes splashLoad {
  from { width: 0%; }
  to   { width: 100%; }
}

/* ── PAGE ENTER TRANSITION ─────────────────────────────────────── */
.page-enter-active {
  animation: pageSlideIn 0.28s ease forwards;
}
@keyframes pageSlideIn {
  from { opacity: 0.6; transform: translateX(10px); }
  to   { opacity: 1;   transform: translateX(0); }
}

/* ── MOBILE UI POLISH ──────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Horizontal scroll containers */
  .scroll-x-mobile {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    padding-bottom: 2px;
  }
  .scroll-x-mobile::-webkit-scrollbar { display: none; }

  /* Card improvements */
  .card, .listing-card, .place-card, .event-card {
    border-radius: 14px !important;
  }

  /* Story row horizontal scroll */
  .story-row, .stories-row, .story-bar {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    flex-wrap: nowrap !important;
  }
  .story-row::-webkit-scrollbar,
  .stories-row::-webkit-scrollbar,
  .story-bar::-webkit-scrollbar { display: none !important; }

  /* Feed grid → single column */
  .feed-grid, .places-grid {
    grid-template-columns: 1fr !important;
  }

  /* Swipeable card visual hint */
  .swipe-hint::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 32px;
    background: linear-gradient(to left, rgba(4,5,13,0.8), transparent);
    pointer-events: none;
    border-radius: 0 14px 14px 0;
  }

  /* Reduce header padding on mobile */
  .navbar { padding: 0 16px !important; }
  .container { padding: 0 16px !important; }

  /* Better hero on mobile */
  .landing-hero { padding: 100px 0 56px !important; }

  /* Touch-friendly form inputs */
  input, select, textarea {
    font-size: 16px !important; /* prevents zoom on iOS */
    border-radius: 10px !important;
    min-height: 46px;
  }

  /* Better modal/sheet feel */
  .modal, .drawer, .bottom-sheet {
    border-radius: 20px 20px 0 0 !important;
  }
}

/* ── DESKTOP: HIDE MOBILE ELEMENTS ─────────────────────────────── */
@media (min-width: 769px) {
  .app-bottom-nav,
  .app-action-overlay,
  .app-action-sheet,
  .app-install-prompt,
  .app-fab-wrap { display: none !important; }
  /* Notifications still show on desktop */
  .app-notif-toast { top: 20px; left: auto; right: 20px; width: 340px; }
}
