:root {
  --bg-color: #050505;
  --bg-surface: #111111;
  --bg-surface-hover: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --border-color: #27272a;
  --danger: #ef4444;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, sans-serif;
  overflow-y: scroll;
  min-height: 100vh;
}

.view {
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.view.active {
  display: block;
  opacity: 1;
}

#landing {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  text-align: center;
}

.hero {
  margin-bottom: 3rem;
}

.title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  background: linear-gradient(to right, #fff, #a1a1aa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

.obs-note {
  font-size: 0.9rem;
  color: #10b981;
  margin-top: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: 1.5rem;
  background: var(--bg-surface);
  padding: 4rem 2rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--bg-surface-hover);
  box-shadow: 0 0 40px var(--accent-glow);
  transform: scale(1.02);
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.icon {
  width: 64px;
  height: 64px;
  color: var(--accent);
  margin-bottom: 1rem;
}

.drop-text {
  font-size: 1.25rem;
  font-weight: 500;
}

.or-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#folder-input {
  display: none;
}

/* Footer */
.landing-footer {
  margin-top: 3rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.landing-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.landing-footer a:hover {
  color: #818cf8;
  text-decoration: underline;
}

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: var(--bg-surface);
}

/* Processing Overlay */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 1.5rem;
  z-index: 10;
}

.overlay.hidden {
  display: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

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

#processing-text {
  font-size: 1.1rem;
  font-weight: 500;
}

.privacy-note {
  margin-top: 2rem;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 0.75rem;
  color: #10b981;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  max-width: 600px;
  text-align: left;
  line-height: 1.5;
}

.privacy-note svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.privacy-note span {
  text-align: center;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: rgba(5, 5, 5, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  flex: 1;
}

.header-right {
  justify-content: flex-end;
  gap: 0.5rem;
}

.header-center {
  display: flex;
  justify-content: center;
  flex: 1;
}

.gallery-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.badge {
  background: var(--bg-surface-hover);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.2);
  cursor: help;
}

.hidden {
  display: none !important;
}

#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  padding: 8px;
}

.pswp-gallery__item {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-surface);
  border-radius: 8px;
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: 200px 200px;
}

.pswp-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
  display: block;
}

.pswp-gallery__item img.loaded {
  opacity: 1;
}

.pswp-gallery__item:hover img {
  transform: scale(1.08);
}

.pswp__filename {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  padding: 6px 14px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.9rem;
  z-index: 100;
  pointer-events: none;
  user-select: none;
  
  max-width: 90vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 600px) {
  .gallery-header {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  #gallery {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 4px;
    padding: 4px;
  }
}