/* friends.leadpoint.tech — warm dark photo-album theme */

:root {
  --bg:        #14110f;
  --bg-soft:   #1c1814;
  --bg-card:   #221d18;
  --bg-card-2: #2a241e;
  --line:      #3a3127;
  --line-soft: #2c2620;
  --ink:       #f4ead8;
  --ink-mute:  #b8aa92;
  --ink-dim:   #7c715f;
  --brass:     #c8993e;
  --brass-2:   #e0b35a;
  --rose:      #d97961;
  --green:     #8fb56b;
  --warn:      #d9a13c;
  --err:       #cf5d4d;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 8px 24px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(800px 500px at 12% -10%, rgba(200,153,62,.08), transparent 60%),
    radial-gradient(900px 600px at 95% 110%, rgba(217,121,97,.06), transparent 60%);
  color: var(--ink);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--brass-2); text-decoration: none; }
a:hover { color: var(--ink); }

/* Nav */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(20,17,15,.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.brand {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.01em;
  color: var(--ink);
}
.brand-dot { color: var(--brass); }
.nav-user { display: flex; align-items: center; gap: 16px; }
.nav-name { color: var(--ink-mute); font-size: 14px; }
.navlink { color: var(--ink-mute); font-size: 14px; }
.navlink:hover { color: var(--brass-2); }

/* Layout */
.container { max-width: 1280px; margin: 0 auto; padding: 36px 28px 80px; }
h1, h2, h3 { font-family: 'Fraunces', serif; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 42px; line-height: 1.1; margin: 0 0 8px; }
h2 { font-size: 26px; margin: 0 0 16px; }
h3 { font-size: 18px; margin: 0 0 8px; }
.subtitle { color: var(--ink-mute); font-size: 16px; margin: 0 0 32px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

/* Cards / categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.cat-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.cat-card:hover { border-color: var(--brass); transform: translateY(-2px); }
.cat-cover {
  aspect-ratio: 4 / 3;
  background: var(--bg-card-2);
  background-size: cover; background-position: center;
}
.cat-meta { padding: 14px 16px; }
.cat-meta h3 { color: var(--ink); margin: 0 0 4px; }
.cat-meta .small { color: var(--ink-dim); font-size: 13px; }

/* Photo grid (motion photos within a category) */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.photo-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-card-2);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid transparent;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile:hover { border-color: var(--brass); }
.photo-tile .badge {
  position: absolute; top: 8px; right: 8px;
  background: rgba(20,17,15,.78);
  color: var(--brass-2);
  font-size: 11px; padding: 3px 7px; border-radius: 4px;
  font-weight: 600;
}
.photo-tile .status-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(20,17,15,.85);
  color: var(--ink-mute);
  font-size: 12px; padding: 6px 10px;
}

/* Frame grid (all frames of one motion photo) */
.frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.frame-cell {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-card-2);
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
}
.frame-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame-cell.selected { border-color: var(--brass); }
.frame-cell.selected::after {
  content: "✓"; position: absolute; top: 4px; right: 6px;
  width: 22px; height: 22px; line-height: 20px; text-align: center;
  background: var(--brass); color: #1a1410; border-radius: 50%;
  font-weight: 700; font-size: 13px;
}
.frame-cell .frame-num {
  position: absolute; left: 6px; bottom: 4px;
  font-size: 10px; color: var(--ink-mute);
  background: rgba(20,17,15,.7); padding: 1px 5px; border-radius: 3px;
}

/* Toolbar (photo viewer) */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  margin-bottom: 16px;
  position: sticky; top: 70px; z-index: 10;
}
.toolbar .sel-count { color: var(--brass-2); font-weight: 600; }
.toolbar .spacer { flex: 1; }

/* Buttons */
.btn {
  display: inline-block;
  font: inherit; font-weight: 600; font-size: 14px;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-card-2);
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--brass); color: var(--brass-2); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--brass);
  border-color: var(--brass);
  color: #1a1410;
}
.btn-primary:hover { background: var(--brass-2); border-color: var(--brass-2); color: #1a1410; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--err); border-color: var(--err); }
.btn-sm { padding: 6px 11px; font-size: 13px; }

/* Forms */
.form { max-width: 420px; margin: 60px auto; }
.form .card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 32px 30px;
  box-shadow: var(--shadow-2);
}
.form h1 { font-size: 28px; margin-bottom: 6px; }
.form .subtitle { font-size: 14px; margin-bottom: 24px; }
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-dim); margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brass);
}
.flash {
  padding: 11px 14px; border-radius: var(--r-sm);
  margin-bottom: 16px; font-size: 14px;
}
.flash-ok  { background: rgba(143,181,107,.12); border: 1px solid var(--green); color: var(--green); }
.flash-err { background: rgba(207, 93, 77,.12); border: 1px solid var(--err); color: var(--err); }
.flash-info{ background: rgba(200,153,62,.12); border: 1px solid var(--brass); color: var(--brass-2); }

/* Tables (admin) */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}
table.tbl th {
  font-weight: 600; color: var(--ink-mute);
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
}

/* Empty state */
.empty {
  text-align: center; padding: 80px 20px;
  color: var(--ink-dim); font-size: 15px;
}
.empty h2 { font-family: 'Fraunces', serif; color: var(--ink-mute); margin-bottom: 6px; }

/* Misc */
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--ink-mute); }
.dim   { color: var(--ink-dim); }
hr.div {
  border: none; border-top: 1px solid var(--line-soft); margin: 24px 0;
}

/* Lightbox / preview */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; box-shadow: var(--shadow-2); }
.lightbox .lb-close {
  position: absolute; top: 18px; right: 22px;
  background: transparent; border: none; color: var(--ink); font-size: 32px; cursor: pointer;
}
.lightbox .lb-meta {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: rgba(20,17,15,.85); padding: 10px 18px; border-radius: var(--r-sm);
  color: var(--ink-mute); font-size: 14px;
}
.lightbox .lb-meta strong { color: var(--brass-2); }
.lightbox .lb-actions { margin-top: 8px; display: flex; gap: 8px; justify-content: center; }

/* Mobile */
@media (max-width: 640px) {
  .container { padding: 20px 14px 60px; }
  h1 { font-size: 32px; }
  .nav { padding: 14px 16px; }
  .toolbar { top: 60px; }
}
/* --- VIDEO ADDITIONS (append to style.css) --- */

.photo-tile .play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(20,17,15,0) 0%, rgba(20,17,15,.5) 100%);
  color: var(--ink);
  font-size: 42px;
  text-shadow: 0 2px 8px rgba(0,0,0,.7);
  pointer-events: none;
  transition: background .2s;
}
.photo-tile:hover .play-overlay {
  background: linear-gradient(180deg, rgba(20,17,15,.2) 0%, rgba(20,17,15,.7) 100%);
  color: var(--brass-2);
}

.video-player {
  background: #000;
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--line-soft);
}
.video-player video {
  width: 100%;
  max-height: 70vh;
  display: block;
}
/* --- ALBUM MULTI-SELECT ADDITIONS (append to style.css) --- */

/* Intro banner */
.intro-banner {
  position: relative;
  background: linear-gradient(135deg, rgba(200,153,62,.10), rgba(217,121,97,.06));
  border: 1px solid var(--brass);
  border-radius: var(--r-lg);
  padding: 22px 26px 18px;
  margin-bottom: 28px;
}
.intro-banner h3 {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  color: var(--brass-2);
  margin: 0 0 12px;
}
.intro-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px 24px;
}
.intro-points li {
  color: var(--ink-mute);
  font-size: 14px;
  line-height: 1.5;
}
.intro-points strong { color: var(--ink); font-weight: 600; }
.intro-close {
  position: absolute; top: 10px; right: 14px;
  background: transparent; border: none;
  color: var(--ink-dim); font-size: 22px;
  cursor: pointer; padding: 0; line-height: 1;
}
.intro-close:hover { color: var(--ink); }

/* Album toolbar */
.album-toolbar {
  display: flex; align-items: center;
  margin-bottom: 16px;
  min-height: 36px;
}
.select-actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--brass);
  border-radius: var(--r-md);
  width: 100%;
}
.select-actions .spacer { flex: 1; }
.select-actions .opt { user-select: none; }

/* Tile wrapper (new) — keeps the checkbox positioned relative to the tile */
.photo-tile-wrap {
  position: relative;
}
.select-check {
  position: absolute;
  top: 10px; left: 10px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(20,17,15,.7);
  border: 2px solid rgba(255,255,255,.4);
  display: none;
  align-items: center; justify-content: center;
  pointer-events: none;
  transition: background .15s, border-color .15s, transform .15s;
}
.select-check .check-icon {
  color: transparent;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}
/* Show checkboxes only in select mode */
body.select-mode .select-check { display: flex; }
body.select-mode .photo-tile { pointer-events: none; }
body.select-mode .photo-tile-wrap { cursor: pointer; }

/* Checked state */
.photo-tile-wrap.checked .select-check {
  background: var(--brass);
  border-color: var(--brass);
  transform: scale(1.05);
}
.photo-tile-wrap.checked .select-check .check-icon { color: #1a1410; }
.photo-tile-wrap.checked .photo-tile {
  outline: 3px solid var(--brass);
  outline-offset: -3px;
}

/* Toast notification */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--brass);
  color: var(--ink);
  padding: 12px 22px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 200;
  font-size: 14px;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
