/* ===== Gallery (images.php) ===== */
:root {
  --bg:       #0a0a0a;
  --surface:  #141414;
  --border:   #222;
  --accent:   #00d4ff;
  --text:     #e0e0e0;
  --muted:    #666;
  --surface-hover: #1f1f1f;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Top Bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .3rem;
  white-space: nowrap;
}

.back-link:hover { text-decoration: underline; }

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Folder Grid View ===== */
.grid-view {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.folder-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .folder-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .folder-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.folder-item {
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}

.folder-item:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0, 212, 255, .15);
}

.folder-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.folder-info {
  padding: .9rem 1rem;
}

.folder-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .35rem;
  line-height: 1.3;
}

.folder-count {
  font-size: .75rem;
  color: var(--muted);
}

/* ===== Spotlight Stage ===== */
.spotlight-container {
  position: relative;
}

.spotlight {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  min-height: 55vh;
}

.spotlight-img {
  max-width: 560px;
  width: 90vw;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
  transition: opacity .3s, transform .3s;
  cursor: grab;
}

.spotlight-img:active { cursor: grabbing; }

.spotlight-caption {
  max-width: 560px;
  width: 90vw;
  text-align: center;
  margin-top: 1rem;
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.5;
}

.spotlight-text-overlay {
  max-width: 560px;
  width: 90vw;
  text-align: center;
  margin-top: .5rem;
  font-size: .8rem;
  color: var(--accent);
  font-weight: 600;
}

/* Navigation Arrows */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  z-index: 50;
  opacity: .7;
}

.nav-arrow:hover { opacity: 1; border-color: var(--accent); background: #1a1a1a; }
.nav-arrow:disabled { opacity: .2; cursor: default; }
.nav-left  { left: 1rem; }
.nav-right { right: 1rem; }

/* Thumbnail Strip */
.thumb-strip {
  display: flex;
  gap: .6rem;
  padding: 1rem 2rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--surface);
  justify-content: center;
  flex-wrap: wrap;
}

.thumb-strip::-webkit-scrollbar { height: 4px; }
.thumb-strip::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

.thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: .45;
  transition: all .2s;
  flex-shrink: 0;
}

.thumb:hover { opacity: .8; }
.thumb.active {
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0,212,255,.3);
}

/* Action Bar */
.action-bar {
  display: flex;
  gap: .75rem;
  padding: 1rem 2rem 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

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

.action-btn:active {
  transform: scale(.97);
}

.btn-icon {
  font-size: 1rem;
}

.back-to-folder {
  color: var(--text);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 6rem 2rem;
  color: var(--muted);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: .95rem; }

/* Keyboard hint */
.hint {
  text-align: center;
  padding: .5rem;
  font-size: .7rem;
  color: var(--muted);
}

.kbd {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1rem .45rem;
  font-size: .65rem;
  margin: 0 .15rem;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #000;
  padding: .75rem 1.5rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* Mobile adjustments */
@media (max-width: 639px) {
  .nav-arrow {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .nav-left { left: .5rem; }
  .nav-right { right: .5rem; }
  
  .folder-grid {
    grid-template-columns: 1fr;
  }
  
  .spotlight-img {
    max-width: 95vw;
  }
  
  .action-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1rem 2rem;
  }
  
  .action-btn {
    justify-content: center;
  }
}