/* ==================== GallerySaaS - Dark Theme ==================== */

:root {
  --bg: #000000;
  --bg-card: #1a1a1a;
  --bg-elevated: #222222;
  --bg-input: #2a2a2a;
  --bg-modal: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #9e9e9e;
  --text-muted: #666666;
  --accent: #4a9eff;
  --accent-hover: #3d8be0;
  --danger: #ff4757;
  --danger-hover: #e8384a;
  --success: #2ed573;
  --warning: #ffa502;
  --orange: #ff6348;
  --border: #333333;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --nav-height: 56px;
  --bar-height: 52px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== Reset ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

/* ==================== Screens ==================== */
.screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1;
}
.screen.active {
  opacity: 1;
  visibility: visible;
  z-index: 10;
}

/* ==================== Auth Screen ==================== */
.auth-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  animation: fadeIn 0.5s ease;
}
.auth-logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.auth-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 32px;
}
.auth-tabs {
  display: flex;
  width: 100%;
  max-width: 360px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}
.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.auth-form {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 360px;
}
.auth-form.active { display: flex; }
.auth-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 16px;
  text-align: center;
  min-height: 20px;
}

/* ==================== Forms ==================== */
.form-group { position: relative; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent);
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 12px; border-radius: var(--radius-xs); }
.icon-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  position: relative;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); }
.icon-btn:active { transform: scale(0.9); }

/* ==================== App Bar ==================== */
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--bar-height);
  padding: 0 12px;
  padding-top: var(--safe-top);
  flex-shrink: 0;
  background: var(--bg);
  z-index: 20;
}
.app-bar-left { display: flex; align-items: center; gap: 8px; }
.app-bar-right { display: flex; align-items: center; gap: 2px; }
.app-bar-title {
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-bar-back { margin-right: 4px; }

/* ==================== Search Bar ==================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  animation: slideDown 0.2s ease;
}
.search-bar.hidden { display: none; }
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-icon { flex-shrink: 0; }

/* ==================== Bottom Navigation ==================== */
.bottom-nav {
  display: flex;
  align-items: stretch;
  height: var(--nav-height);
  padding-bottom: var(--safe-bottom);
  background: var(--bg);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 20;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  padding: 6px 0;
}
.nav-item.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.nav-item:active { transform: scale(0.92); }
.nav-item::after {
  content: attr(data-label);
  font-size: 10px;
  font-weight: 500;
}

/* ==================== Content Area ==================== */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
}

/* ==================== Albums Grid ==================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 12px 8px;
}
.section-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.section-header a, .section-header button {
  font-size: 13px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
}
.albums-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 12px 12px;
}
.album-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}
.album-card:active { transform: scale(0.96); }
.album-cover {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-elevated);
  object-fit: cover;
}
.album-cover-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.album-info {
  padding: 8px 10px 10px;
}
.album-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-count {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* ==================== Category Chips ==================== */
.chips-row {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chips-row::-webkit-scrollbar { display: none; }
.chip {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
}
.chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.chip:active { transform: scale(0.95); }
.chip-add {
  border-style: dashed;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==================== Gallery Detail (Images Grid) ==================== */
.gallery-header {
  padding: 12px 12px 8px;
}
.gallery-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.gallery-meta svg { width: 14px; height: 14px; flex-shrink: 0; }
.gallery-actions {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
}
.images-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 0 0 12px;
}
.image-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
}
.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
  will-change: transform;
}
.image-item:active img { transform: scale(1.05); }
.image-fav-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  color: var(--danger);
  pointer-events: none;
}
.image-select {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.image-select.checked {
  background: var(--accent);
  border-color: var(--accent);
}

/* ==================== Image Viewer ==================== */
.viewer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  z-index: 100;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  touch-action: none;
}
.viewer-overlay.active {
  opacity: 1;
  visibility: visible;
}
.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  padding-top: calc(var(--safe-top) + 8px);
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
  transition: opacity 0.3s ease;
}
.viewer-title {
  font-size: 14px;
  color: white;
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewer-fav.active svg path { fill: var(--danger); }
.viewer-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.viewer-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.15s ease-out;
  transform-origin: center center;
  will-change: transform;
  -webkit-user-drag: none;
}
.viewer-counter {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.5);
  padding: 4px 12px;
  border-radius: 12px;
}
.viewer-hint {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 40px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  opacity: 1;
  transition: opacity 1s ease 3s;
}
.viewer-hint.hide { opacity: 0; }

/* ==================== Upload View ==================== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  margin: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(74,158,255,0.05);
}
.upload-zone svg { margin-bottom: 12px; opacity: 0.5; }
.upload-zone p { color: var(--text-secondary); font-size: 13px; }
.upload-zone .upload-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.upload-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 12px;
}
.upload-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card);
}
.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-thumb .remove-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-progress {
  padding: 12px;
}
.progress-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ==================== Favorites ==================== */
.fav-image-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
}
.fav-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fav-image-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 8px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  font-size: 11px;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== Settings / Menu ==================== */
.menu-section {
  padding: 12px;
}
.menu-section-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 4px;
  font-weight: 600;
}
.menu-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  color: var(--text-primary);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--bg-elevated); }
.menu-item:active { background: rgba(255,255,255,0.05); }
.menu-item-icon {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.menu-item-text { flex: 1; }
.menu-item-arrow {
  color: var(--text-muted);
  font-size: 18px;
}
.menu-item.danger { color: var(--danger); }
.menu-item.danger .menu-item-icon { color: var(--danger); }

/* Profile card */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin: 12px;
}
.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}
.profile-info { flex: 1; overflow: hidden; }
.profile-name { font-size: 16px; font-weight: 600; }
.profile-plan {
  font-size: 12px;
  color: var(--accent);
  margin-top: 2px;
}
.profile-stats {
  display: flex;
  gap: 16px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* ==================== Admin Panel ==================== */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.admin-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.admin-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}
.admin-user-info { flex: 1; }
.admin-user-name { font-weight: 500; }
.admin-user-email { font-size: 12px; color: var(--text-secondary); }
.admin-user-actions { display: flex; gap: 4px; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}
.badge-admin { background: var(--accent); color: white; }
.badge-inactive { background: var(--danger); color: white; }
.badge-plan { background: var(--bg-elevated); color: var(--text-secondary); }

/* ==================== Modals ==================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--bg-modal);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.modal-overlay.active .modal-box {
  transform: translateY(0);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-modal);
  z-index: 1;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 16px; }
.modal-body .form-group { margin-bottom: 12px; }
.modal-body .btn { margin-top: 8px; }
.modal-actions {
  display: flex;
  gap: 10px;
  padding: 0 16px 16px;
}
.modal-actions .btn { flex: 1; }

/* Centered modal for share screen password */
.share-view .modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.share-view .modal.hidden { display: none; }
.share-view .modal-box {
  border-radius: var(--radius);
  text-align: center;
  padding: 32px 24px;
  max-width: 320px;
  transform: none;
  background: var(--bg-modal);
}
.share-view .modal-box h3 { font-size: 18px; margin-bottom: 8px; }
.share-view .modal-box p { color: var(--text-secondary); font-size: 13px; margin-bottom: 20px; }
.share-view .modal-box input { width: 100%; margin-bottom: 12px; }

/* ==================== Share Info ==================== */
.share-info {
  padding: 12px 12px 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.share-views {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==================== Toast ==================== */
#toast-container {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
  left: 12px;
  right: 12px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: white;
  pointer-events: auto;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--accent); }

/* ==================== Loading ==================== */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-overlay.hidden { display: none; }
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ==================== Empty State ==================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}
.empty-state svg { margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--text-muted); max-width: 260px; }

/* ==================== Toggle Switch ==================== */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-elevated);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::after { transform: translateX(20px); }

/* ==================== Animations ==================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes staggerIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.stagger-in {
  animation: staggerIn 0.3s ease both;
}

/* ==================== Responsive (Tablet+) ==================== */
@media (min-width: 600px) {
  .albums-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .images-grid { grid-template-columns: repeat(4, 1fr); }
  .upload-preview { grid-template-columns: repeat(6, 1fr); }
  .auth-container { max-width: 420px; margin: 0 auto; }
}
@media (min-width: 900px) {
  .albums-grid { grid-template-columns: repeat(5, 1fr); }
  .images-grid { grid-template-columns: repeat(5, 1fr); }
  .modal-box { border-radius: var(--radius); margin: auto; }
  .modal-overlay { align-items: center; }
}
@media (min-width: 1200px) {
  .albums-grid { grid-template-columns: repeat(6, 1fr); }
  .images-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ==================== Image loading placeholder ==================== */
.img-loading {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
