/* SeekStories mobile receive page.
   Mobile-first; designed for portrait phones primarily. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #0a0a0a;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ── Brand chrome ─────────────────────────────────────────────── */
.ss-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
}
.ss-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ff0075;
  flex-shrink: 0;
}
.ss-brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ── State containers ─────────────────────────────────────────── */
.ss-state {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.ss-hidden { display: none !important; }

/* ── LOADING STATE ────────────────────────────────────────────── */
#ss-loading {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}
#ss-loading .ss-brand {
  margin-bottom: 48px;
}
.ss-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #ff0075;
  border-radius: 50%;
  animation: ss-spin 0.9s linear infinite;
  margin-bottom: 24px;
}
@keyframes ss-spin {
  to { transform: rotate(360deg); }
}
.ss-status {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.65);
}

/* ── GALLERY STATE ────────────────────────────────────────────── */
.ss-header {
  flex-shrink: 0;
}
.ss-tagline {
  padding: 0 20px 16px 20px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}

.ss-slides {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 20px;
}
.ss-slide-thumb {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255, 0, 117, 0.2);
  aspect-ratio: 1 / 1;
  touch-action: manipulation;
}
.ss-slide-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ss-slide-thumb-index {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  letter-spacing: 0.02em;
}

.ss-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.ss-disclaimer {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  line-height: 1.4;
}

/* ── BUTTONS ──────────────────────────────────────────────────── */
.ss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  padding: 0 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease;
}
.ss-btn:active {
  opacity: 0.75;
}
.ss-btn-primary {
  background: #ff0075;
  color: #ffffff;
}
.ss-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* ── FULL-SCREEN PREVIEW ──────────────────────────────────────── */
.ss-preview {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.ss-preview-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ss-preview-img {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  max-height: calc(100dvh - 200px);
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 24px;
}
.ss-preview-hint {
  margin-top: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  max-width: 320px;
  line-height: 1.4;
}

/* ── ERROR STATE ──────────────────────────────────────────────── */
#ss-error {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}
.ss-error-title {
  margin-top: 24px;
  font-size: 22px;
  font-weight: 700;
}
.ss-error-body {
  margin-top: 12px;
  max-width: 320px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}
