/*
  Gallery Page Styles
  Theme: Matches wedding site design tokens
*/

:root {
  --ivory: #FFF9C4;
  --sage: #B8D233;
  --rose: #FF4081;
  --gold: #FFD700;
  --forest: #1B5E20;
  --fiesta-orange: #FF9F1C;
  --fiesta-coral: #F08E98;
  --white: #FFFFFF;
  --text: #333333;
  --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

body {
  font-family: 'Montserrat', sans-serif;
  color: var(--text);
  background-color: var(--white);
  line-height: 1.6;
}

h1, h2, h3, .serif {
  font-family: 'Playfair Display', serif;
  color: var(--forest);
  font-weight: 400;
}

/* ── Navigation ─────────────────────────────────────── */
.nav-bar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 1rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--forest);
  font-weight: 700;
}

.nav-page-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--forest);
  font-weight: 600;
}

/* ── Gallery Page Layout ────────────────────────────── */
.gallery-page {
  padding-top: 80px;
  min-height: 100vh;
}

.gallery-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.gallery-subtitle {
  text-align: center;
  max-width: 500px;
  margin: 0 auto 2rem;
  color: #777;
  font-size: 0.95rem;
}

/* ── Upload Section ─────────────────────────────────── */
.upload-section {
  padding: 3rem 2rem;
  background: linear-gradient(180deg, var(--ivory) 0%, var(--white) 100%);
}

.upload-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--white);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

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

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
  color: var(--forest);
}

.form-group input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(184, 210, 51, 0.15);
}

/* Upload Area */
.upload-area {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 1.25rem;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--sage);
  background: rgba(184, 210, 51, 0.04);
}

.upload-placeholder {
  pointer-events: none;
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.upload-placeholder p {
  color: #888;
  font-size: 0.9rem;
}

.upload-hint {
  font-size: 0.75rem !important;
  opacity: 0.6;
  margin-top: 0.25rem;
}

.upload-preview {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  object-fit: contain;
}

/* Progress Bar */
.progress-container {
  margin-bottom: 1.25rem;
}

.progress-bar {
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--forest));
  border-radius: 4px;
  transition: width 0.3s;
  width: 0%;
}

.progress-text {
  font-size: 0.75rem;
  color: #888;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-upload {
  width: 100%;
  background: var(--forest);
  color: var(--white);
}

.btn-upload:hover:not(:disabled) {
  background: #2e7d32;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27, 94, 32, 0.3);
}

.btn-load-more {
  display: block;
  margin: 2rem auto;
  background: transparent;
  color: var(--forest);
  border: 2px solid var(--forest);
}

.btn-load-more:hover {
  background: var(--forest);
  color: var(--white);
}

/* ── QR Share Card ──────────────────────────────────── */
.qr-share-section {
  padding: 2rem 2rem 0;
  display: flex;
  justify-content: center;
}

.qr-share-card {
  text-align: center;
  background: var(--ivory);
  padding: 2rem;
  border-radius: 16px;
  max-width: 280px;
}

.qr-share-img {
  width: 180px;
  height: 180px;
  margin-bottom: 1rem;
}

.qr-share-text {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--forest);
  margin-bottom: 0.25rem;
}

.qr-share-url {
  font-size: 0.7rem;
  color: #999;
  letter-spacing: 0.3px;
}

/* ── Gallery Section ────────────────────────────────── */
.gallery-section {
  padding: 2rem 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-section-title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 2rem;
  position: relative;
}

.gallery-section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(to right, var(--sage), var(--fiesta-coral));
  margin: 0.75rem auto 0;
}

/* Masonry Grid */
.gallery-grid {
  column-count: 3;
  column-gap: 1rem;
}

.gallery-empty {
  text-align: center;
  color: #bbb;
  font-style: italic;
  padding: 3rem 1rem;
  column-span: all;
}

/* Gallery Item */
.gallery-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s;
}

.gallery-item:hover {
  transform: scale(1.02);
}

.gallery-item img {
  width: 100%;
  display: block;
  border-radius: 10px;
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: var(--white);
  border-radius: 0 0 10px 10px;
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-name {
  font-weight: 600;
  font-size: 0.8rem;
}

.gallery-item-caption {
  font-size: 0.75rem;
  opacity: 0.85;
  margin-top: 0.15rem;
}

/* ── Lightbox ───────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  text-align: center;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-info {
  padding: 0.75rem 0;
  color: var(--white);
}

.lightbox-name {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
}

.lightbox-caption {
  font-size: 0.8rem;
  opacity: 0.7;
  display: block;
  margin-top: 0.25rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 3001;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  color: white;
  background: rgba(255,255,255,0.1);
  border: none;
  cursor: pointer;
  padding: 1rem 0.75rem;
  border-radius: 4px;
  z-index: 3001;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
}

.lightbox-nav:hover {
  opacity: 1;
  background: rgba(255,255,255,0.2);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .gallery-grid {
    column-count: 2;
  }

  .gallery-title {
    font-size: 2rem;
  }

  .upload-section {
    padding: 2rem 1.25rem;
  }

  .upload-card {
    padding: 1.5rem;
  }

  .gallery-section {
    padding: 1.5rem 1.25rem 3rem;
  }

  /* Always show overlay on mobile */
  .gallery-item-overlay {
    opacity: 1;
  }

  .lightbox-nav {
    padding: 0.75rem 0.5rem;
    font-size: 1.5rem;
  }

  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    column-count: 1;
  }

  .gallery-title {
    font-size: 1.7rem;
  }

  .gallery-subtitle {
    font-size: 0.85rem;
  }

  .upload-area {
    min-height: 150px;
    padding: 1.5rem;
  }

  .nav-logo {
    font-size: 1.2rem;
  }
}
