/* ===== LUMINA MEDIA GALLERY ===== */
/* Design: Dark cinematic with violet-amber accent system */

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --surface: #16161f;
  --surface2: #1e1e2a;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);

  --violet: #7c5cfc;
  --violet-dim: rgba(124,92,252,0.15);
  --violet-glow: rgba(124,92,252,0.3);
  --amber: #f59e0b;
  --amber-dim: rgba(245,158,11,0.15);
  --emerald: #10b981;
  --rose: #f43f5e;
  --sky: #38bdf8;

  --text: #e8e8f0;
  --text2: #9090a8;
  --text3: #5a5a72;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 0.4s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== HEADER ===== */
#header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 56px;
  max-width: 1600px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-icon {
  font-size: 20px;
  color: var(--violet);
  line-height: 1;
  filter: drop-shadow(0 0 8px var(--violet));
}

.logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.bc-item {
  font-size: 13px;
  color: var(--text3);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition);
  text-overflow: ellipsis;
  overflow: hidden;
}
.bc-item:hover { color: var(--text2); }
.bc-item.active { color: var(--text); cursor: default; }
.bc-sep { color: var(--text3); font-size: 11px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.btn-icon svg { width: 18px; height: 18px; }
.btn-icon:hover { background: var(--surface2); color: var(--text); }
.btn-icon.active { background: var(--violet-dim); color: var(--violet); }

/* Sort Menu */
.sort-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 160px;
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
  pointer-events: none;
  transition: all var(--transition);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.sort-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.sort-option {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  transition: all var(--transition);
}
.sort-option:hover { background: var(--surface2); color: var(--text); }
.sort-option.active { color: var(--violet); }

/* ===== SEARCH BAR ===== */
.search-bar {
  overflow: hidden;
  max-height: 0;
  border-top: 0px solid var(--border);
  transition: max-height 0.3s ease, border var(--transition);
}
.search-bar.open {
  max-height: 72px;
  border-top: 1px solid var(--border);
}

.search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  max-width: 1600px;
  margin: 0 auto;
}

.search-inner svg { width: 16px; height: 16px; color: var(--text3); flex-shrink: 0; }

.search-inner input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
}
.search-inner input::placeholder { color: var(--text3); }

.search-filters {
  display: flex;
  gap: 4px;
}

.filter-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text3);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.filter-btn:hover { border-color: var(--border2); color: var(--text2); }
.filter-btn.active { background: var(--violet); border-color: var(--violet); color: white; }

/* ===== MAIN ===== */
#main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* Stats */
.stats-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text2);
  font-family: var(--font-mono);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text3);
}
.img-dot { background: var(--violet); box-shadow: 0 0 6px var(--violet); }
.vid-dot { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.aud-dot { background: var(--emerald); box-shadow: 0 0 6px var(--emerald); }

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar.hidden { display: none; }

.filter-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.filter-tab svg { width: 14px; height: 14px; }
.filter-tab:hover { border-color: var(--border2); color: var(--text); }
.filter-tab.active { background: var(--violet-dim); border-color: var(--violet); color: var(--violet); }

.filter-spacer { flex: 1; }

.btn-slideshow {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--amber-dim);
  border: 1px solid var(--amber);
  color: var(--amber);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.btn-slideshow svg { width: 13px; height: 13px; }
.btn-slideshow:hover { background: var(--amber); color: #000; }

/* ===== MEDIA GRID ===== */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.media-grid.list-view {
  grid-template-columns: 1fr;
  gap: 6px;
}

/* Album Card */
.album-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  group: true;
}
.album-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px var(--border2);
}

.album-cover {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg3);
}

.album-cover img,
.album-cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.album-card:hover .album-cover img,
.album-card:hover .album-cover video { transform: scale(1.06); }

.album-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--bg3) 0%, var(--surface2) 100%);
  color: var(--text3);
}
.album-cover-placeholder svg { width: 40px; height: 40px; opacity: 0.4; }

.album-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}
.album-card:hover .album-cover-overlay { opacity: 1; }

.album-badges {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
}
.badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  backdrop-filter: blur(8px);
}
.badge-img { background: rgba(124,92,252,0.8); color: white; }
.badge-vid { background: rgba(245,158,11,0.8); color: #000; }
.badge-aud { background: rgba(16,185,129,0.8); color: white; }

.album-info {
  padding: 14px 16px;
}

.album-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-meta {
  font-size: 12px;
  color: var(--text3);
  font-family: var(--font-mono);
}

/* Media Card */
.media-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}
.media-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.media-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg3);
}
.media-thumb img, .media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.media-card:hover .media-thumb img,
.media-card:hover .media-thumb video { transform: scale(1.08); }

.media-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
}
.media-thumb-placeholder svg { width: 36px; height: 36px; }

.media-type-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  backdrop-filter: blur(8px);
  background: rgba(0,0,0,0.6);
  color: var(--text2);
  text-transform: uppercase;
}

.video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity var(--transition);
}
.media-card:hover .video-play-overlay { opacity: 1; }
.play-btn-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.play-btn-circle svg { width: 18px; height: 18px; color: white; margin-left: 2px; }

.media-info {
  padding: 10px 12px;
}
.media-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.media-size {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--font-mono);
}

/* Audio card special */
.audio-card .media-thumb {
  background: linear-gradient(135deg, #0d1f1a 0%, #0a2218 100%);
  aspect-ratio: 1;
}
.audio-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
}
.wv-bar {
  width: 3px;
  background: var(--emerald);
  border-radius: 2px;
  opacity: 0.4;
  animation: waveAnim 1.2s ease-in-out infinite;
}
.audio-card:hover .wv-bar { opacity: 0.8; }
@keyframes waveAnim {
  0%, 100% { height: 20%; }
  50% { height: 80%; }
}

/* List view cards */
.media-grid.list-view .media-card {
  display: flex;
  border-radius: var(--radius-sm);
}
.media-grid.list-view .media-thumb {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  aspect-ratio: unset;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.media-grid.list-view .media-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.media-grid.list-view .media-name { margin-bottom: 0; font-size: 13px; }
.media-grid.list-view .media-size { flex-shrink: 0; }
.media-grid.list-view .media-type-badge { position: static; }

/* ===== LOADING ===== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 20px;
  color: var(--text3);
  font-size: 13px;
}
.loading.hidden { display: none; }

.loader {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border2);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text3);
}
.empty-state.hidden { display: none; }
.empty-icon { font-size: 48px; opacity: 0.2; margin-bottom: 16px; }
.empty-state h2 { font-family: var(--font-display); font-size: 20px; color: var(--text2); margin-bottom: 8px; }
.empty-state p { font-size: 13px; }
.empty-state code { font-family: var(--font-mono); background: var(--surface2); padding: 2px 6px; border-radius: 4px; color: var(--violet); }

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: stretch;
  transition: opacity var(--transition);
}
.lightbox.hidden { display: none; }
.lightbox.fadein { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,5,10,0.96);
}

.lb-container {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.lb-close svg { width: 18px; height: 18px; }
.lb-close:hover { background: var(--rose); border-color: var(--rose); color: white; }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border2);
  background: rgba(22,22,31,0.8);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
}
.lb-nav svg { width: 20px; height: 20px; }
.lb-nav:hover { background: var(--violet); border-color: var(--violet); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px 80px;
  position: relative;
}

.lb-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
  transition: transform 0.2s ease;
  cursor: grab;
}
.lb-media img.dragging { cursor: grabbing; }
.lb-media video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
}
.lb-media audio-player {
  width: 100%;
  max-width: 500px;
}

/* Audio player in lightbox */
.audio-lb-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 480px;
}
.audio-lb-art {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #0d1f1a, #1a0d2e);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border2);
}
.audio-lb-art svg { width: 64px; height: 64px; color: var(--emerald); opacity: 0.5; }
.audio-lb-info { text-align: center; }
.audio-lb-name { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.audio-lb-size { font-size: 12px; color: var(--text3); font-family: var(--font-mono); }
.audio-lb-controls { width: 100%; }
.audio-lb-controls audio { width: 100%; }

.lb-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
}

.lb-info { flex: 1; min-width: 0; }
.lb-filename {
  display: block;
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-meta {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--font-mono);
}

.lb-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}
.lb-tool {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.lb-tool svg { width: 15px; height: 15px; }
.lb-tool:hover { background: var(--surface2); color: var(--text); }

.lb-zoom-level {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text3);
  min-width: 36px;
  text-align: center;
}

.lb-counter {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text3);
  white-space: nowrap;
}

/* Thumbnail strip */
.lb-thumbs {
  display: flex;
  gap: 6px;
  padding: 10px 20px;
  background: var(--bg);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.lb-thumbs::-webkit-scrollbar { height: 3px; }
.lb-thumbs::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.lb-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 42px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  background: var(--bg3);
}
.lb-thumb img, .lb-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.lb-thumb:hover { border-color: var(--border2); }
.lb-thumb.active { border-color: var(--violet); }

.lb-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
}
.lb-thumb-placeholder svg { width: 16px; height: 16px; color: var(--text3); }

/* ===== SLIDESHOW ===== */
.slideshow-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.slideshow-overlay.hidden { display: none; }

.ss-media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ss-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ss-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 10px 16px;
}

.ss-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.ss-btn svg { width: 16px; height: 16px; }
.ss-btn:hover { background: var(--surface2); }

.ss-speed {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
}
.ss-speed input[type=range] { width: 80px; accent-color: var(--violet); }
#ssSpeedLabel { font-family: var(--font-mono); font-size: 11px; min-width: 24px; }

.ss-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.1);
}
.ss-bar {
  height: 100%;
  background: var(--violet);
  transition: none;
}
.ss-bar.animate {
  transition: width linear;
}

.ss-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text2);
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== CONTEXT MENU ===== */
.context-menu {
  position: fixed;
  z-index: 500;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 160px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  animation: ctxIn 0.15s ease;
}
@keyframes ctxIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.context-menu.hidden { display: none; }

.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  transition: all var(--transition);
}
.ctx-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.ctx-item:hover { background: var(--surface2); color: var(--text); }
.ctx-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease;
  min-width: 200px;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.fadeout { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}
.toast-icon { font-size: 16px; flex-shrink: 0; }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
}

.modal-box {
  position: relative;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  margin: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-family: var(--font-display); font-size: 15px; }
.modal-header button {
  border: none;
  background: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 16px;
  transition: color var(--transition);
}
.modal-header button:hover { color: var(--text); }

.modal-body { padding: 16px 20px 20px; }

.info-row {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text3); flex-shrink: 0; width: 80px; font-family: var(--font-mono); font-size: 11px; padding-top: 1px; }
.info-value { color: var(--text); word-break: break-all; font-family: var(--font-mono); font-size: 12px; }

/* ===== HIDDEN UTILITY ===== */
.hidden { display: none !important; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-inner { padding: 0 14px; }
  #main { padding: 16px 14px 80px; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .lb-nav { width: 36px; height: 36px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
  .lb-media { padding: 16px 56px; }
  .lb-thumbs { display: none; }
  .lb-toolbar { flex-wrap: wrap; gap: 8px; }
  .ss-controls { top: 12px; right: 12px; padding: 8px 12px; }
  .ss-speed input[type=range] { width: 60px; }
  .search-filters { display: none; }
}

@media (max-width: 480px) {
  .media-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stats-bar { gap: 6px; }
  .stat-pill { padding: 4px 10px; font-size: 11px; }
  .album-card { border-radius: var(--radius); }
  .logo-text { display: none; }
}

/* Search results */
.search-results-header {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}
.search-results-header span { color: var(--violet); }

/* Fade in animation for cards */
.media-card, .album-card {
  animation: cardIn 0.3s ease backwards;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Drag over highlight */
.drag-active { border-color: var(--violet) !important; background: var(--violet-dim) !important; }