/* ============================================================================
   VEYA — Actions stylesheet
   Covers: emoji panel, help banner, modals, settings screen, story viewer,
   compose post, create circle, toggles, kaupapa cards, photo bubbles.
   ============================================================================ */

/* ---- EMOJI PANEL (Pulse composer) ----------------------------------------- */
.emoji-panel {
  position: absolute; left: 12px; right: 12px; bottom: 70px;
  background: var(--void-1); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 10px;
  display: none; grid-template-columns: repeat(8, 1fr); gap: 4px;
  z-index: 30;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.emoji-panel.open { display: grid; animation: fadeUp 0.2s ease-out; }
.emoji-btn {
  width: 100%; aspect-ratio: 1; border-radius: 8px; font-size: 20px;
  background: transparent; transition: background 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.emoji-btn:hover { background: rgba(255,255,255,0.06); }

/* ---- PHOTO BUBBLES (Pulse) ------------------------------------------------ */
.bubble-photo { padding: 4px; overflow: hidden; }
.bubble-photo img { display: block; max-width: 220px; border-radius: 14px; }

/* ---- HELP BANNER (NavMe) -------------------------------------------------- */
.help-banner {
  position: absolute; top: 12px; left: 12px; right: 56px; z-index: 11;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(244,90,110,0.18);
  border: 1px solid rgba(244,90,110,0.45);
  border-radius: 12px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.help-banner.show { opacity: 1; transform: translateY(0); pointer-events: auto; animation: helpThrob 1.6s ease-in-out infinite; }
@keyframes helpThrob { 0%,100% { box-shadow: 0 0 0 0 rgba(244,90,110,0); } 50% { box-shadow: 0 0 0 6px rgba(244,90,110,0.18); } }
.help-banner-pulse {
  width: 10px; height: 10px; border-radius: 50%; background: var(--red);
  flex-shrink: 0; animation: blink 1.2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(244,90,110,0.6);
}
.help-banner-text { flex: 1; font-size: 14px; color: var(--ink); line-height: 1.35; }
.help-banner-text strong { color: var(--red); font-weight: 600; }
.help-banner-clear {
  background: rgba(255,255,255,0.1); color: var(--ink);
  padding: 7px 12px; border-radius: 8px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--line-2); transition: background 0.2s;
  flex-shrink: 0;
}
.help-banner-clear:hover { background: rgba(255,255,255,0.18); }

/* ---- ROLLCALL state (chips) ----------------------------------------------- */
.nav-chips.rollcall-active .nav-chip {
  animation: chipPulse 1.8s ease-in-out infinite;
}
@keyframes chipPulse {
  0%,100% { border-color: var(--line); }
  50%     { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(25,210,210,0.15); }
}

/* ---- LOCATE-ME flash on map ----------------------------------------------- */
.map-fallback.centring::before {
  content: ''; position: absolute; left: 48%; top: 50%;
  width: 24px; height: 24px; margin: -12px 0 0 -12px;
  border-radius: 50%; border: 2px solid var(--cyan);
  animation: locatePulse 1.4s ease-out;
  pointer-events: none;
}
@keyframes locatePulse {
  0%   { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(4);   opacity: 0; }
}

/* ---- MODAL (compose-post + create-circle) --------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.25s ease;
}
.modal.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 100%; max-width: 420px; max-height: 92%;
  background: var(--void-1);
  border: 1px solid var(--line-2);
  border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  animation: slideUp 0.32s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
  overflow: hidden;
}
@media (min-width: 640px) {
  .modal { align-items: center; }
  .modal-card { border-radius: 20px; }
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-x {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-d); font-size: 22px; line-height: 1;
}
.modal-x:hover { background: rgba(255,255,255,0.06); color: var(--ink); }
.modal-title { font-family: var(--display); font-size: 17px; font-weight: 500; }
.modal-go {
  background: var(--grad); color: white;
  padding: 8px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  transition: transform 0.15s;
}
.modal-go:hover { transform: translateY(-1px); }
.modal-body {
  padding: 16px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 12px;
}
.modal-body::-webkit-scrollbar { display: none; }
.modal-label {
  font-size: 12px; color: var(--ink-d);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: -4px; font-weight: 600;
}
.modal-input {
  width: 100%; padding: 12px 14px;
  background: var(--void-2); border: 1px solid var(--line);
  border-radius: 12px; color: var(--ink);
  font-family: inherit; font-size: 15px; outline: 0;
}
.modal-input:focus { border-color: rgba(25,210,210,0.4); }

/* compose-post specifics */
.compose-author { display: flex; gap: 12px; align-items: center; }
.compose-name { font-weight: 600; font-size: 14px; }
.compose-circle {
  margin-top: 4px;
  background: var(--void-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; font-size: 13px; font-family: inherit; outline: 0;
}
.compose-text {
  width: 100%; min-height: 100px; resize: vertical;
  background: var(--void-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
  color: var(--ink); font-family: inherit; font-size: 15px;
  line-height: 1.5; outline: 0;
}
.compose-text:focus { border-color: rgba(25,210,210,0.4); }
.compose-photo-preview { position: relative; }
.compose-photo-preview img {
  width: 100%; height: auto; max-height: 400px; object-fit: contain;
  border-radius: var(--r); display: block;
}
.compose-photo-clear {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,0.65); color: white;
  font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.compose-tools { display: flex; gap: 8px; }
.compose-tool {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px;
  background: var(--void-2); border: 1px solid var(--line);
  color: var(--ink); font-size: 14px; font-weight: 600;
  transition: all 0.15s;
}
.compose-tool:hover { background: var(--void-3); color: var(--ink); border-color: var(--cyan); }

/* member picks (create-circle) */
.member-picks {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 280px; overflow-y: auto;
}
.member-picks::-webkit-scrollbar { display: none; }
.member-pick {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  background: var(--void-2); border: 1px solid var(--line);
  cursor: pointer; transition: all 0.15s;
}
.member-pick:hover { border-color: var(--line-2); }
.member-pick input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 5px;
  background: var(--void-3); border: 1.5px solid var(--line-2);
  position: relative; cursor: pointer; flex-shrink: 0;
  transition: all 0.15s;
}
.member-pick input[type="checkbox"]:checked {
  background: var(--grad); border-color: transparent;
}
.member-pick input[type="checkbox"]:checked::after {
  content: ''; position: absolute;
  left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid white; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.member-pick span { font-size: 14px; color: var(--ink); }

/* ---- SETTINGS SCREEN (full overlay) --------------------------------------- */
.settings-screen {
  position: absolute; inset: 0; z-index: 90;
  background: var(--void);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.32s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}
.settings-screen.open { transform: translateX(0); }
.settings-screen-head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.settings-back {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; color: var(--ink-d);
}
.settings-back:hover { background: rgba(255,255,255,0.05); color: var(--ink); }
.settings-screen-title {
  font-family: var(--display); font-size: 20px; font-weight: 500;
}
.settings-screen-body {
  flex: 1; overflow-y: auto; padding: 16px 20px 24px;
}
.settings-screen-body::-webkit-scrollbar { display: none; }
.settings-block { display: flex; flex-direction: column; gap: 12px; }
.settings-intro {
  font-size: 12px; color: var(--ink-d);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin: 0; font-weight: 600;
}

/* toggle */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 12px;
  background: var(--void-2); border: 1px solid var(--line);
}
.toggle-row span { font-size: 14px; color: var(--ink); }
.toggle {
  width: 44px; height: 26px; border-radius: 999px;
  background: rgba(255,255,255,0.08); position: relative;
  transition: background 0.2s;
}
.toggle.on { background: var(--grad); }
.toggle-dot {
  position: absolute; left: 3px; top: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: white;
  transition: transform 0.2s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.toggle.on .toggle-dot { transform: translateX(18px); }

/* kaupapa cards (privacy explainer) */
.kaupapa-card {
  padding: 18px;
  background: linear-gradient(135deg, rgba(25,210,210,0.06), rgba(139,92,246,0.06));
  border: 1px solid var(--line); border-radius: var(--r);
  display: flex; flex-direction: column; gap: 8px;
}
.kaupapa-icon { font-size: 24px; }
.kaupapa-card h3 {
  font-family: var(--display); font-size: 17px; font-weight: 500;
  margin: 0; color: var(--ink);
}
.kaupapa-card p {
  font-size: 14px; line-height: 1.55; color: var(--ink-d); margin: 0;
}

/* devices */
.device-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 12px;
  background: var(--void-2); border: 1px solid var(--line);
}
.device-icon { font-size: 22px; }
.device-main { flex: 1; min-width: 0; }
.device-name { font-size: 14px; color: var(--ink); font-weight: 500; }
.device-meta { font-size: 12px; color: var(--ink-d); margin-top: 2px; }
.device-current {
  font-size: 9px; padding: 4px 8px; border-radius: 999px;
  background: var(--grad); color: white;
  font-weight: 700; letter-spacing: 0.1em;
}
.device-out {
  padding: 7px 14px; border-radius: 999px;
  background: rgba(244,90,110,0.15); color: var(--red);
  font-size: 12px; font-weight: 700;
  border: 1px solid rgba(244,90,110,0.3);
}

/* segmented control */
.seg-row { display: flex; gap: 6px; flex-wrap: wrap; }
.seg {
  padding: 11px 16px; border-radius: 999px;
  background: var(--void-2); border: 1px solid var(--line);
  color: var(--ink); font-size: 14px; font-weight: 600;
  flex: 1; min-width: max-content;
  transition: all 0.15s;
}
.seg:hover { border-color: var(--line-2); color: var(--ink); }
.seg.on {
  background: var(--grad); color: white; border-color: transparent;
}

/* FAQ details */
.faq {
  background: var(--void-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
}
.faq summary {
  cursor: pointer; font-size: 14px; color: var(--ink); font-weight: 500;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--ink-q); font-size: 18px; line-height: 1; }
.faq[open] summary::after { content: '−'; }
.faq p {
  margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-d);
}
.contact-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 12px;
  background: var(--void-2); border: 1px solid var(--line);
}
.contact-row span { font-size: 15px; color: var(--ink); font-weight: 500; }
.contact-row a { color: var(--cyan); font-size: 15px; text-decoration: none; font-weight: 600; }
.contact-row a:hover { text-decoration: underline; }

/* ---- POST PHOTO custom (Flow) --------------------------------------------- */
.post-photo-custom { background: var(--void-2); }
.post-photo-custom img {
  width: 100%; height: auto; max-height: 480px; object-fit: contain;
}

/* ---- STORY VIEWER --------------------------------------------------------- */
.story-viewer {
  position: fixed; inset: 0; z-index: 250;
  background: var(--void);
  display: none; flex-direction: column;
  animation: fadeIn 0.2s ease;
}
.story-viewer.open { display: flex; }
.story-viewer-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  padding: env(safe-area-inset-top, 14px) 16px 12px;
  display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), transparent);
}
.story-progress {
  height: 3px; background: rgba(255,255,255,0.2); border-radius: 2px;
  overflow: hidden; position: relative;
}
.story-progress::after {
  content: ''; position: absolute; left: 0; top: 0;
  height: 100%; width: 0; background: white; border-radius: 2px;
}
.story-progress.running::after {
  animation: storyProgress 4s linear forwards;
}
@keyframes storyProgress { from { width: 0; } to { width: 100%; } }
.story-viewer-meta {
  display: flex; align-items: center; gap: 8px;
  color: white;
}
.story-viewer-name { font-family: var(--display); font-size: 16px; font-weight: 600; }
.story-viewer-time { font-size: 13px; opacity: 0.85; }
.story-viewer-x {
  position: absolute; top: env(safe-area-inset-top, 14px); right: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.4); color: white;
  font-size: 22px; line-height: 1;
}
.story-viewer-stage {
  flex: 1; position: relative; display: flex;
}
.story-tap-left, .story-tap-right {
  flex: 1; cursor: pointer; z-index: 2;
}
.story-content {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
}
.story-bg {
  width: 100%; height: 100%; object-fit: cover;
}
.story-bg-initial {
  width: 100%; height: 100%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
}
.story-bg-initial span {
  font-family: var(--display);
  font-size: 140px;
  font-weight: 500;
  color: white;
  filter: drop-shadow(0 0 40px rgba(0,0,0,0.4));
}

/* --- POST REPLIES (Flow inline replies) ----------------------------------- */
.post-replies {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
}
.post-reply { display: flex; gap: 10px; align-items: flex-start; }
.post-reply-body { flex: 1; min-width: 0; }
.post-reply-head {
  font-size: 13px; color: var(--ink-d); display: flex; gap: 6px; align-items: baseline;
}
.post-reply-head strong { color: var(--ink); font-weight: 600; font-size: 14px; }
.post-reply-text {
  font-size: 15px; line-height: 1.5; color: var(--ink); margin-top: 2px;
}
.post-reply-composer {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex; gap: 8px; align-items: center;
}
.post-reply-input {
  flex: 1; padding: 10px 16px;
  background: var(--void-2); border: 1px solid var(--line);
  border-radius: 999px; color: var(--ink);
  font-family: inherit; font-size: 15px; outline: 0;
}
.post-reply-input:focus { border-color: rgba(25,210,210,0.4); }
.post-reply-input::placeholder { color: var(--ink-q); }
.post-reply-send {
  padding: 9px 16px; border-radius: 999px;
  background: var(--grad); color: white;
  font-size: 13px; font-weight: 700; border: 0;
  font-family: inherit; cursor: pointer;
  transition: transform 0.15s;
}
.post-reply-send:hover { transform: translateY(-1px); }

/* --- INVITE FRIENDS modal -------------------------------------------------- */
.invite-qr {
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: white; border-radius: 16px;
}
.invite-link-row {
  display: flex; gap: 8px; align-items: stretch;
}
.invite-link-row .modal-input {
  font-size: 13px; padding: 12px;
  font-family: 'SF Mono', Monaco, monospace;
}
.invite-copy {
  padding: 0 20px; border-radius: 12px;
  background: var(--grad); color: white;
  font-size: 14px; font-weight: 700; border: 0;
  font-family: inherit; cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s;
}
.invite-copy:hover { transform: translateY(-1px); }
.invite-share-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.invite-share {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px; border-radius: 12px;
  background: var(--void-2); border: 1px solid var(--line);
  color: var(--ink); font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: all 0.15s;
}
.invite-share:hover { border-color: var(--cyan); color: var(--ink); }
.invite-share svg { color: var(--cyan); }

/* --- VEYA MAP — real-map pins --------------------------------------------- */
.map-pin-real {
  transition: transform 0.2s;
}
.map-pin-real:hover { transform: scale(1.1); }
.map-pin-real.ring-safe    { box-shadow: 0 0 0 2px var(--aqua),   0 4px 14px rgba(0,0,0,0.35); }
.map-pin-real.ring-travel  { box-shadow: 0 0 0 2px var(--cyan),   0 4px 14px rgba(0,0,0,0.35); }
.map-pin-real.ring-work    { box-shadow: 0 0 0 2px var(--amber),  0 4px 14px rgba(0,0,0,0.35); }
.map-pin-real.ring-help    { box-shadow: 0 0 0 2px var(--red),    0 4px 14px rgba(0,0,0,0.35); animation: helpThrob 1.6s ease-in-out infinite; }
.map-pin-real.ring-offline { box-shadow: 0 0 0 2px rgba(255,255,255,0.3), 0 4px 14px rgba(0,0,0,0.35); }
.map-pin-real.me::before {
  content: '';
  position: absolute; inset: -8px; border-radius: 50%;
  background: radial-gradient(circle, rgba(25,210,210,0.4) 0%, transparent 70%);
  animation: pulseGlow 2.4s ease-in-out infinite;
  z-index: -1;
}
