/* ==========================================================================
   isgallery.yyserver.cc - Iceland 2026 Travel Gallery Stylesheet
   Theme: Luminous Nordic Light Theme (Clean, Elder-Friendly, Photo-First)
   Vertical Chronological Swipe (Swipe down/up by dates), Category Filter (DSLR, Drone, Gopro)
   ========================================================================== */

:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-input: #ffffff;

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --primary-blue: #0284c7;
  --primary-blue-hover: #0369a1;
  --primary-blue-light: #e0f2fe;

  --accent-emerald: #059669;
  --accent-emerald-hover: #047857;
  --accent-emerald-light: #d1fae5;

  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-active: #0284c7;

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 20px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px -4px rgba(0, 0, 0, 0.12);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.45;
  overflow-x: hidden;
  padding-bottom: 70px;
}

/* ==========================================================================
   Welcome & Onboarding Modal (Language -> Member -> PIN)
   ========================================================================== */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(241, 245, 249, 0.94);
  backdrop-filter: blur(24px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.onboarding-overlay.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.onboarding-box {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.onboarding-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-emerald-light);
  color: #065f46;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.onboarding-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.onboarding-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-blue);
}

/* Step 1: Language Buttons */
.lang-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.lang-card-btn {
  background: var(--bg-subtle);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  color: var(--text-main);
  user-select: none;
}

.lang-card-btn:hover {
  border-color: var(--primary-blue);
  background: var(--primary-blue-light);
}

.lang-card-btn.active {
  border-color: var(--primary-blue);
  background: var(--primary-blue-light);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.lang-flag {
  font-size: 2rem;
}

.lang-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.lang-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Step 2: Member Grid */
.pax-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
  margin-bottom: 16px;
}

.pax-card-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
  user-select: none;
}

.pax-card-btn:hover {
  background: #e2e8f0;
}

.pax-card-btn.selected {
  background: var(--accent-emerald-light);
  border-color: var(--accent-emerald);
  color: #065f46;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.25);
}

.pax-avatar {
  font-size: 1.3rem;
}

/* Step 3: PIN Dots & Keypad */
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}

.pin-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-dot.filled {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  box-shadow: 0 0 10px rgba(5, 150, 105, 0.4);
  transform: scale(1.18);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.pin-key {
  aspect-ratio: 1;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-main);
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  user-select: none;
  box-shadow: var(--shadow-xs);
}

.pin-key:active {
  background: #e2e8f0;
  transform: scale(0.92);
}

.pin-key.action-key {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pin-error {
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 20px;
  margin-top: 6px;
}

/* ==========================================================================
   Header: Bright, Crisp, Friendly
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-light);
  padding: 10px 16px;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  font-size: 1.6rem;
}

.brand-title-group h1 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.guest-greeting-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-blue-light);
  color: var(--primary-blue);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #047857, #059669);
}

.btn-secondary {
  background: var(--bg-subtle);
  border-color: var(--border-light);
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

/* ==========================================================================
   Category Selection Tabs: DSLR, Drone, Gopro
   ========================================================================== */
.category-filter-strip {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  padding: 10px 16px;
  position: sticky;
  top: 55px;
  z-index: 90;
}

.category-filter-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cat-pill-group {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.cat-pill-group::-webkit-scrollbar { display: none; }

.cat-pill {
  padding: 7px 15px;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.cat-pill:hover {
  background: #e2e8f0;
}

.cat-pill.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

/* Vertical Date Dropdown Selector */
.date-jump-select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}

.date-jump-select:focus {
  border-color: var(--primary-blue);
}

/* ==========================================================================
   Vertical Chronological Feed (Swipe Down / Up by Date)
   ========================================================================== */
.vertical-gallery-feed {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.day-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.day-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: 110px;
  z-index: 70;
}

.day-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-title-icon {
  font-size: 1.25rem;
}

.day-title-text {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-main);
}

.day-count-badge {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 640px) {
  .day-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}

@media (min-width: 1024px) {
  .day-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
}

.media-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  aspect-ratio: 4/3;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.media-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cat-indicator-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.item-overlay {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, transparent 100%);
  padding: 18px 8px 6px;
  color: #ffffff;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  font-size: 0.72rem;
}

/* ==========================================================================
   Fullscreen Lightbox Viewer
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s ease;
}

.lightbox-modal.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lightbox-top {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.lightbox-info {
  font-size: 0.9rem;
  color: #cbd5e1;
}

.btn-lightbox-close {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
}

.lightbox-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.lightbox-media {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
}

.lightbox-prev { left: 14px; }
.lightbox-next { right: 14px; }

.lightbox-bottom {
  padding: 14px 20px 24px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.95), transparent);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lightbox-caption {
  font-size: 0.9rem;
  color: #e2e8f0;
  text-align: center;
}

.lightbox-btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Modals (Upload & ZIP)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: opacity 0.2s ease;
}

.modal-overlay.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-box {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.modal-title-row h2 {
  font-size: 1.25rem;
  font-weight: 800;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-select {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  margin-bottom: 14px;
  outline: none;
}

.upload-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: var(--radius-md);
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  margin-bottom: 16px;
  transition: all 0.2s;
}

.upload-dropzone:hover {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-light);
}

.live-progress-box {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 14px;
}

.live-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.live-progress-bar-bg {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.live-progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #059669, #0284c7);
  border-radius: var(--radius-full);
  transition: width 0.15s ease-out;
}

.live-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  z-index: 99999;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s;
  pointer-events: none;
  white-space: nowrap;
}

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