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

:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --bg-hover: #1a1a1a;
  --text: #e8e8e8;
  --text-muted: #888;
  --accent: #c8a84e;
  --accent-hover: #dabb5e;
  --border: #222;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* Header */
header {
  padding: 40px 24px 32px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 14px;
  letter-spacing: 4px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 24px;
}

.brand-sub {
  font-weight: 300;
  color: var(--text-muted);
}

.event-info h1 {
  font-size: 36px;
  font-weight: 300;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.event-date {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 4px;
}

.event-desc {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 500px;
  margin: 0 auto;
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

/* Error */
.error-state {
  text-align: center;
  padding: 120px 24px;
  color: var(--text-muted);
}

.error-state h2 {
  font-weight: 400;
  margin-bottom: 8px;
  color: var(--text);
}

/* Gallery Grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 4px;
  padding: 4px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-elevated);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.gallery-item img.loaded {
  opacity: 1;
}

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

.gallery-item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 60%, rgba(0,0,0,0.6));
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 12px;
}

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

.overlay-stats {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
}

/* Load more */
.load-more {
  text-align: center;
  padding: 32px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.btn-download {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 500;
}

.btn-download:hover {
  background: var(--accent-hover);
}

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

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 32px;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.1);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 80px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 40px;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.1);
}

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

.lightbox-content {
  max-width: 90vw;
  max-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* Share modal */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  min-width: 300px;
  text-align: center;
}

.share-modal-content h3 {
  margin-bottom: 24px;
  font-weight: 400;
}

.share-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.share-option:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.btn-close-modal {
  width: 100%;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
}

/* Footer */
.footer {
  padding: 48px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

.qr-container {
  display: inline-block;
  padding: 12px;
  background: white;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.qr-container img, .qr-container canvas {
  display: block;
}

.footer-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-brand {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 640px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    padding: 2px;
  }

  .event-info h1 {
    font-size: 24px;
  }

  header {
    padding: 24px 16px 20px;
  }

  .lightbox-nav {
    width: 36px;
    font-size: 28px;
  }

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

  .lightbox-actions {
    flex-direction: column;
    width: 80%;
  }

  .lightbox-actions .btn {
    justify-content: center;
    width: 100%;
  }
}

@media (min-width: 1200px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 3000;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
