:root {
  --bg-start: #f5f7fa;
  --bg-end: #c3cfe2;
  --accent: #0099ff;
  --ink: #1a1f2b;
}
body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 2rem;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  color: var(--ink);
}

body.with-header {
  /* Ensure page content starts below the fixed header */
  padding-top: 120px;
}

body.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
  padding: 0.5rem 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-title h1 {
  margin: 0;
}

.header-eyebrow {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(26, 31, 43, 0.6);
}


.top-header img {
  height: 60px;
}

.logo-center {
  text-align: center;
  margin-top: 2rem;
}

.logo-center img {
  width: 200px;
  height: auto;
}

.hero {
  width: min(920px, 100%);
}

.hero-card {
  background: rgba(255, 255, 255, 0.82);
  padding: 3rem;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
  text-align: center;
}

.hero-logo {
  width: 140px;
  height: auto;
}

.hero-tagline {
  font-size: 1.4rem;
  font-weight: 500;
  margin: 1rem 0 0.5rem;
}

.hero-copy {
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 auto 1.5rem;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.hero-note {
  font-size: 0.95rem;
  color: rgba(26, 31, 43, 0.7);
}

.primary-button {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  display: inline-block;
}

.primary-button:hover {
  background: #007acc;
}

.header-download {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  margin-left: auto;
}

.header-download:hover {
  background: #007acc;
}

.album-meta {
  margin: 1.5rem 0 1rem;
  font-size: 1rem;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
}

#controls-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}
#logout-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 4px;
  display: none;
}
#logout-btn:hover {
  background: #007acc;
}

.with-header #logout-btn {
  position: static;
  display: inline-block;
  margin-right: 40px;
}

#return-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 4px;
  margin-top: 1rem;
}
#return-btn:hover {
  background: #007acc;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.controls button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
}
.controls button:hover {
  background: #007acc;
}
.controls input[type="text"],
.controls select {
  padding: 0.6rem;
  font-size: 1.05rem;
}

#file-upload {
  padding: 0.6rem;
  font-size: 1.1rem;
}
#photos {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
}

.photo-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.photo-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.photo-item img,
.photo-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-item.video-item::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 1.5rem 0 1.5rem 2.4rem;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.8);
  pointer-events: none;
}
#viewer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
#viewer-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
#viewer-content img,
#viewer-content video {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  z-index: 1;
  border-radius: 8px;
}
#viewer > button:not(#download-btn):not(#share-btn) {
  position: absolute;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 2rem;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 2;
  border-radius: 50%;
}
#prev-btn { left: 0.5rem; }
#next-btn { right: 0.5rem; }
#close-btn {
  top: 1rem;
  right: 1rem;
  transform: none;
  margin-top: 20px;
}

#download-btn,
#share-btn {
  position: absolute;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  z-index: 2;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
}

#download-btn {
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 2rem);
  text-align: center;
}

#share-btn {
  top: 2rem;
  left: 2rem;
}

#upload-progress {
  width: 100%;
  height: 1rem;
  display: none;
}

/* Responsive adjustments for small screens */
@media (max-width: 900px) {
  #photos {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  /* Hide the site title to save space next to the logo */
  .site-title {
    display: none;
  }

  body {
    padding: 1.5rem;
  }

  body.with-header {
    padding-top: 100px;
  }

  .hero-card {
    padding: 2rem 1.5rem;
  }

  #photos {
    grid-template-columns: repeat(2, 1fr);
  }
}
