/* ===== CSS VARIABLES ===== */
:root {
  --bg: #f5f5f7;
  --bg-card: #ffffff;
  --bg-header: rgba(255,255,255,0.85);
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --border: #e5e5ea;
  --primary: #6C63FF;
  --primary-light: #8B83FF;
  --primary-dark: #5046e5;
  --accent: #FF6584;
  --success: #34C759;
  --warning: #FF9F0A;
  --danger: #FF3B30;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --nav-height: 72px;
  --header-height: 56px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d1a;
    --bg-card: #1c1c2e;
    --bg-header: rgba(13,13,26,0.9);
    --text: #f5f5f7;
    --text-secondary: #98989f;
    --border: #2c2c3a;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
  }
}

[data-theme="dark"] {
  --bg: #0d0d1a;
  --bg-card: #1c1c2e;
  --bg-header: rgba(13,13,26,0.9);
  --text: #f5f5f7;
  --text-secondary: #98989f;
  --border: #2c2c3a;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

/* ===== RTL ===== */
[dir="rtl"] { direction: rtl; text-align: right; }
[dir="rtl"] #btn-back svg { transform: rotate(180deg); }
[dir="rtl"] .breadcrumb-title { margin-left: 0; margin-right: 8px; }

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--primary); text-decoration: none; }

.hidden { display: none !important; }

/* ===== LANDING PAGE ===== */
#page-landing {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.landing-hero {
  text-align: center;
  max-width: 480px;
  animation: fadeUp 0.6s ease-out;
}

.landing-logo {
  margin-bottom: 16px;
}

.landing-logo .logo-icon {
  font-size: 64px;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 20px rgba(108,99,255,0.4));
}

.landing-logo h1 {
  font-size: 42px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
}

.landing-logo .accent { color: var(--primary-light); }

.landing-tagline {
  font-size: 20px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
  font-weight: 600;
}

.landing-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  margin-bottom: 32px;
}

.landing-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 36px;
}

.feature-card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
}

.feature-card span {
  font-size: 28px;
  display: block;
  margin-bottom: 6px;
}

.feature-card h3 {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.feature-card p {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

.landing-version {
  margin-top: 24px;
  font-size: 12px;
  color: rgba(255,255,255,0.25);
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-large { padding: 16px 48px; font-size: 18px; border-radius: 14px; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.btn-small { padding: 8px 14px; font-size: 13px; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  color: var(--text-secondary);
}

.icon-btn:hover { background: var(--border); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: rgba(255,59,48,0.1); }

/* ===== HEADER ===== */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 100;
  gap: 8px;
}

#btn-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#btn-back:hover { background: var(--border); }

#breadcrumb {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.breadcrumb-title {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#header-actions { display: flex; align-items: center; gap: 8px; }

/* Sync indicator */
.sync-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sync-dot-inner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: background 0.3s;
}

.sync-dot.synced .sync-dot-inner { background: var(--success); }
.sync-dot.pending .sync-dot-inner { background: var(--warning); animation: pulse 1.5s infinite; }
.sync-dot.error .sync-dot-inner { background: var(--danger); }

/* ===== MAIN CONTENT ===== */
#app-main {
  padding-top: var(--header-height);
  padding-bottom: var(--nav-height);
  min-height: 100vh;
  min-height: 100dvh;
}

.page { padding: 16px; }
.page.active { display: block; }

/* ===== CARDS GRID ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 14px;
}

/* Folder card */
.folder-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  border: 2px solid transparent;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.folder-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.folder-card:active { transform: scale(0.97); }
.folder-card[draggable="true"] { touch-action: auto; -webkit-user-select: none; user-select: none; }

.folder-card .card-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.folder-card .card-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.folder-card .card-count {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.folder-card .card-color-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* ===== DRAG AND DROP ===== */
.folder-card.dragging {
  opacity: 0.3;
  transform: scale(0.95);
  pointer-events: none;
}

.folder-card.drop-target-active {
  border: 2px dashed var(--primary-light);
}

.folder-card.drag-over {
  border: 2px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--bg-card));
  transform: scale(1.04);
  box-shadow: 0 0 20px rgba(108,99,255,0.25);
}

.drop-parent-zone {
  background: color-mix(in srgb, var(--primary) 8%, var(--bg));
  border: 2px dashed var(--primary-light);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 14px;
  transition: all 0.2s;
}

.drop-parent-zone.drag-over {
  background: color-mix(in srgb, var(--primary) 18%, var(--bg));
  border-color: var(--primary);
  transform: scale(1.02);
  box-shadow: 0 0 16px rgba(108,99,255,0.2);
}

.drag-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.85;
  transform: rotate(3deg) scale(1.05);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  transition: none;
}

/* Item card */
.item-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  border-left: 4px solid var(--primary);
}

.item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.item-card:active { transform: scale(0.97); }

.item-card .card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.item-card .card-preview {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-card .card-photos-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.item-card .card-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 14px;
}

.item-card:hover .card-copy-btn { opacity: 1; }
@media (hover: none) { .item-card .card-copy-btn { opacity: 0.7; } }

/* ===== ITEM VIEW ===== */
#item-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

#item-view-title {
  font-size: 22px;
  font-weight: 800;
}

.item-actions { display: flex; gap: 4px; }

.field-row {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.field-row:active { background: var(--border); }

.field-row .field-key {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.field-row .field-value {
  font-size: 15px;
  font-weight: 500;
  word-break: break-word;
}

.field-row .copy-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity 0.2s;
}

.field-row:hover .copy-hint { opacity: 1; }
@media (hover: none) { .field-row .copy-hint { opacity: 0.5; } }

/* Photos in item view */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== ITEM EDIT FORM ===== */
#item-edit-form {
  max-width: 600px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.field-edit-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.field-edit-row input {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-card);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.field-edit-row input:focus {
  outline: none;
  border-color: var(--primary);
}

.field-edit-row input:first-child { flex: 0.4; font-weight: 600; }

.field-edit-row .btn-remove-field {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  font-size: 18px;
  flex-shrink: 0;
}

.field-edit-row .btn-remove-field:hover { background: rgba(255,59,48,0.1); }

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.form-actions .btn-primary { flex: 1; }
.form-actions .btn-secondary { flex: 0.5; }

/* Photos in edit mode */
#item-photos-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.photo-edit-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.photo-edit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-edit-thumb .btn-remove-photo {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== SEARCH ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
}

.search-bar input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.search-bar svg { color: var(--text-secondary); flex-shrink: 0; }

/* ===== EMPTY STATES ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.empty-state p { color: var(--text-secondary); font-size: 15px; font-weight: 600; }
.empty-sub { font-size: 13px !important; font-weight: 400 !important; margin-top: 4px; }

/* ===== BOTTOM NAV ===== */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 100;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  border-radius: 12px;
  transition: all 0.2s;
  min-width: 56px;
}

.nav-btn span { font-size: 10px; font-weight: 600; }
.nav-btn svg { color: var(--text-secondary); transition: color 0.2s; }
.nav-btn.active svg { color: var(--primary); }
.nav-btn.active span { color: var(--primary); }

.nav-btn.add-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(108,99,255,0.4);
  transform: translateY(-8px);
  padding: 0;
  min-width: auto;
}

.nav-btn.add-btn svg { color: #fff; }
.nav-btn.add-btn:active { transform: translateY(-6px) scale(0.95); }

/* ===== FAB MENU ===== */
#fab-menu { position: fixed; inset: 0; z-index: 200; }

.fab-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
}

.fab-options {
  position: absolute;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeUp 0.2s ease-out;
}

.fab-option {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border-radius: 28px;
  padding: 14px 24px;
  box-shadow: var(--shadow-lg);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.fab-option:hover { background: var(--border); }
.fab-option-icon { font-size: 22px; }

/* ===== MODAL ===== */
#modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
}

#modal-box {
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  animation: slideUp 0.3s ease-out;
}

@media (min-width: 600px) {
  #modal-overlay { align-items: center; }
  #modal-box { border-radius: var(--radius); }
}

/* Folder creation modal */
.modal-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 20px;
}

.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.emoji-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: all 0.15s;
}

.emoji-btn.selected {
  background: var(--primary);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(108,99,255,0.3);
}

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.color-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: all 0.15s;
  border: 3px solid transparent;
}

.color-btn.selected {
  border-color: var(--text);
  transform: scale(1.15);
}

/* ===== CONFIRM DIALOG ===== */
#confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
}

.confirm-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  width: 300px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.2s ease-out;
}

#confirm-message {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.4;
}

.confirm-actions { display: flex; gap: 10px; }
.confirm-actions button { flex: 1; }
.confirm-actions .btn-primary { background: var(--danger); }

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  top: calc(var(--header-height) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 400px;
}

.toast {
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--success);
  pointer-events: auto;
  animation: slideDown 0.3s ease-out;
}

.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

/* ===== SETTINGS ===== */
.settings-list {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.settings-item:last-child { border-bottom: none; }
.settings-item span:first-child { font-weight: 600; }
.settings-value { color: var(--text-secondary); font-size: 13px; }

.settings-item select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

.settings-footer {
  text-align: center;
  margin-top: 32px;
  padding: 16px;
}

.version-link {
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background 0.2s;
}

.version-link:hover { background: var(--border); }

/* ===== ADMIN ===== */
.admin-section {
  margin-bottom: 24px;
}

.admin-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.admin-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.error-log {
  max-height: 60vh;
  overflow-y: auto;
}

.error-entry {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.error-entry .error-time {
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.error-entry .error-source {
  color: var(--warning);
  font-weight: 700;
}

.error-entry .error-msg {
  color: var(--danger);
  margin-top: 4px;
  word-break: break-all;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card .stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== PHOTO LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox img {
  max-width: 95%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
  }

  .page { padding: 24px; }

  #app-main { max-width: 900px; margin: 0 auto; }
}
