/* ══════════════════════════════════════════════════════════
   MY FOTOVENTURE JOURNAL — PWA Styles
   Dark cinematic design matching FotoVentures site
   ══════════════════════════════════════════════════════════ */

:root {
  --ink: #FAF5E5;
  --ink-soft: rgba(250,245,229,0.85);
  --ink-muted: rgba(250,245,229,0.55);
  --ink-faint: rgba(250,245,229,0.35);
  --dark: #0E0D06;
  --dark-card: #1B1B1B;
  --dark-border: #2E2D2A;
  --gold: #DCA54A;
  --gold-deep: #D09A40;
  --gold-glow: rgba(220,165,74,0.15);
  --gold-soft: rgba(220,165,74,0.08);
  --cream: #FAF5E5;
  --content-max: 720px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --bottom-nav-h: 64px;
  --top-bar-h: 56px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--dark);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.25;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-deep); }

img { max-width: 100%; display: block; }

/* ══════════════════════════════════════════════════════════
   AUTH PAGE (index.html)
   ══════════════════════════════════════════════════════════ */

.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 1.25rem;
}

.auth-logo {
  width: 160px;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.auth-title {
  font-size: 1.75rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
  text-align: center;
}

.auth-subtitle {
  color: var(--ink-muted);
  font-size: 0.95rem;
  max-width: 360px;
  text-align: center;
  margin-bottom: 2.5rem;
  line-height: 1.5;
}

/* Auth card container */
.auth-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 400px;
}

.auth-section-label {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

/* Code input */
.code-input-group {
  display: flex;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.code-input-group input {
  flex: 1;
  background: var(--dark);
  border: 1px solid var(--dark-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--ink);
  font-family: 'DM Sans', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s var(--ease);
}

.code-input-group input::placeholder {
  color: var(--ink-faint);
  letter-spacing: 0.05em;
  text-transform: none;
}

.code-input-group input:focus {
  border-color: var(--gold);
}

/* Gold button */
.btn-gold {
  background: var(--gold);
  color: var(--dark);
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.1s;
  white-space: nowrap;
}

.btn-gold:hover { background: var(--gold-deep); }
.btn-gold:active { transform: scale(0.97); }
.btn-gold:disabled { opacity: 0.5; cursor: not-allowed; }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0;
  color: var(--ink-faint);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--dark-border);
}

/* Google section */
.google-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#google-signin-btn {
  margin-top: 0.25rem;
}

/* Error messages */
.auth-error {
  color: #E05252;
  font-size: 0.85rem;
  min-height: 1.25rem;
  margin-bottom: 0.25rem;
}

.google-error {
  color: #E05252;
  font-size: 0.85rem;
  min-height: 1.25rem;
  margin-top: 0.5rem;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════
   APP SHELL (app.html)
   ══════════════════════════════════════════════════════════ */

/* Top bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-bar-h);
  background: var(--dark-card);
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 100;
}

.top-bar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-bar-logo {
  height: 28px;
  opacity: 0.9;
}

.top-bar-trip {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.top-bar-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4CAF50;
}

.status-dot.offline { background: #E05252; }

/* Content area */
.app-content {
  margin-top: var(--top-bar-h);
  margin-bottom: var(--bottom-nav-h);
  padding: 1rem 1rem 1.5rem;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  min-height: calc(100vh - var(--top-bar-h) - var(--bottom-nav-h));
  min-height: calc(100dvh - var(--top-bar-h) - var(--bottom-nav-h));
}

/* Tab views */
.tab-view { display: none; }
.tab-view.active { display: block; }

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: var(--dark-card);
  border-top: 1px solid var(--dark-border);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: none;
  border: none;
  color: var(--ink-muted);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  position: relative;
  transition: color 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.nav-tab svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-tab.active {
  color: var(--gold);
}

.nav-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: var(--gold);
  border-radius: 0 0 2px 2px;
}

/* ══════════════════════════════════════════════════════════
   BANNER — Profile Incomplete
   ══════════════════════════════════════════════════════════ */

.banner {
  background: var(--gold-glow);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.banner:hover { background: var(--gold-soft); }

.banner-icon {
  color: var(--gold);
  flex-shrink: 0;
}

.banner-text strong {
  color: var(--gold);
}

.banner.hidden { display: none; }

/* ══════════════════════════════════════════════════════════
   ENTRY CARDS — Journal Timeline
   ══════════════════════════════════════════════════════════ */

.entries-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.entry-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  padding: 1rem 1.125rem;
  transition: border-color 0.2s var(--ease);
}

.entry-card:hover {
  border-color: var(--ink-faint);
}

.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.entry-type-icon {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.entry-type-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.entry-time {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.entry-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Highlight star */
.star-toggle {
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
}

.star-toggle.active { color: var(--gold); }
.star-toggle svg {
  width: 18px;
  height: 18px;
}

/* Edit countdown badge */
.edit-badge {
  font-size: 0.7rem;
  background: var(--gold-glow);
  color: var(--gold);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

.entry-text {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.entry-media {
  margin-top: 0.75rem;
  border-radius: 8px;
  overflow: hidden;
}

.entry-media img {
  width: 100%;
  border-radius: 8px;
}

.entry-audio {
  margin-top: 0.75rem;
}

.entry-audio audio {
  width: 100%;
  height: 36px;
  border-radius: 8px;
}

.entries-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-muted);
}

.entries-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

/* ══════════════════════════════════════════════════════════
   RECORDER BUTTON
   ══════════════════════════════════════════════════════════ */

.recorder-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
}

.recorder-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gold);
  border: 4px solid var(--gold-deep);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.3s var(--ease);
  position: relative;
}

.recorder-btn svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.recorder-btn:active { transform: scale(0.95); }

.recorder-btn.recording {
  animation: pulse-record 1.5s infinite;
  box-shadow: 0 0 0 0 var(--gold-glow);
}

@keyframes pulse-record {
  0% { box-shadow: 0 0 0 0 rgba(220,165,74,0.4); }
  70% { box-shadow: 0 0 0 18px rgba(220,165,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(220,165,74,0); }
}

.recorder-status {
  font-size: 0.9rem;
  color: var(--ink-muted);
  text-align: center;
}

.recorder-timer {
  font-family: 'DM Sans', monospace;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.05em;
}

/* New entry type selector */
.entry-type-select {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.type-chip {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  color: var(--ink-muted);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.type-chip.active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-glow);
}

/* Text entry area */
.text-entry-area {
  width: 100%;
  max-width: var(--content-max);
}

.text-entry-area textarea {
  width: 100%;
  min-height: 140px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  padding: 1rem;
  color: var(--ink);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s var(--ease);
}

.text-entry-area textarea::placeholder { color: var(--ink-faint); }
.text-entry-area textarea:focus { border-color: var(--gold); }

/* ══════════════════════════════════════════════════════════
   PROFILE FORM
   ══════════════════════════════════════════════════════════ */

.profile-section {
  padding: 0.5rem 0;
}

.profile-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 0.375rem;
  font-weight: 500;
}

.form-input,
.form-select {
  width: 100%;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--ink);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s var(--ease);
}

.form-input:focus,
.form-select:focus { border-color: var(--gold); }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23FAF5E5' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-top: 0.25rem;
}

/* Radio group */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}

.radio-option:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.radio-option input[type="radio"] {
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
}

.radio-option span {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ══════════════════════════════════════════════════════════
   SURVEY FORM
   ══════════════════════════════════════════════════════════ */

.survey-section {
  padding: 0.5rem 0;
}

.survey-section h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.survey-desc {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.survey-question {
  margin-bottom: 1.5rem;
}

.survey-question label {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Star rating */
.star-rating {
  display: flex;
  gap: 0.5rem;
}

.star-rating button {
  background: none;
  border: none;
  color: var(--dark-border);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.star-rating button.filled { color: var(--gold); }
.star-rating button svg { width: 28px; height: 28px; }

/* Star buttons (text stars in survey) */
.star-btn {
  background: none;
  border: none;
  color: var(--dark-border);
  cursor: pointer;
  padding: 0.125rem;
  font-size: 1.5rem;
  line-height: 1;
  transition: color 0.15s;
}

.star-btn.filled { color: var(--gold); }

/* Rating section & groups */
.rating-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.rating-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 0.375rem;
  font-weight: 500;
}

/* NPS slider */
.nps-slider {
  margin-top: 0.5rem;
}

.nps-range {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--dark-border);
  border-radius: 3px;
  outline: none;
}

.nps-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: 2px solid var(--gold-deep);
}

.nps-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: 2px solid var(--gold-deep);
}

.nps-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.nps-value {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
}

/* Survey disabled & complete states */
.survey-disabled {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--ink-muted);
}

.survey-disabled h3 {
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

/* Survey textarea — matches text entry */
.survey-textarea {
  width: 100%;
  min-height: 80px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: var(--ink);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s var(--ease);
}

.survey-textarea::placeholder { color: var(--ink-faint); }
.survey-textarea:focus { border-color: var(--gold); }

/* Toggle switch for testimonial permission */
.toggle-group {
  margin-bottom: 1.5rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.toggle-label input[type="checkbox"] {
  accent-color: var(--gold);
  width: 18px;
  height: 18px;
}

/* Large button variant */
.btn-large {
  padding: 0.875rem 2rem;
  font-size: 1rem;
}

.survey-submitted {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--ink-muted);
}

.survey-submitted h2 {
  color: var(--gold);
  margin-bottom: 0.5rem;
}

/* ══════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════ */

.btn-outline {
  background: transparent;
  border: 1px solid var(--dark-border);
  border-radius: 10px;
  padding: 0.625rem 1.25rem;
  color: var(--ink-soft);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.btn-outline:hover {
  border-color: var(--ink-muted);
  color: var(--ink);
}

.btn-block { width: 100%; }

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--dark-border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 1rem);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s var(--ease);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Offline indicator */
.offline-bar {
  position: fixed;
  top: var(--top-bar-h);
  left: 0;
  right: 0;
  background: #E05252;
  color: #fff;
  text-align: center;
  font-size: 0.8rem;
  padding: 0.25rem;
  z-index: 99;
  display: none;
}

.offline-bar.visible { display: block; }

/* Upload area */
.upload-area {
  border: 2px dashed var(--dark-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  color: var(--ink-muted);
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}

.upload-area:hover { border-color: var(--ink-faint); }

.upload-area input[type="file"] { display: none; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

@media (min-width: 480px) {
  .auth-title { font-size: 2rem; }
  .auth-card { padding: 2.25rem 2rem; }
}

@media (min-width: 768px) {
  .app-content {
    padding: 1.5rem 2rem 2rem;
  }
}
