/* ===== FAMILY GALLERY – SHARED STYLES ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Lato:wght@300;400;700&display=swap');

:root {
  --cream: #faf6f0;
  --warm: #f0e6d3;
  --brown: #6b4c35;
  --dark: #2c1f14;
  --gold: #c9973a;
  --gold-light: #e8c47a;
  --shadow: rgba(44,31,20,0.14);
  --red: #c0392b;
}

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

body {
  background: var(--cream);
  font-family: 'Lato', sans-serif;
  color: var(--dark);
  min-height: 100vh;
}

/* ── NAVBAR ── */
nav {
  background: #fff;
  border-bottom: 1px solid #ecdec8;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px var(--shadow);
}

.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-badge {
  background: linear-gradient(135deg, var(--brown), var(--gold));
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: 99px;
  font-weight: 700;
  letter-spacing: 1px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.welcome {
  font-size: 0.85rem;
  color: var(--brown);
  font-weight: 300;
}

/* ── BUTTONS ── */
.btn {
  padding: 9px 20px;
  border-radius: 10px;
  font-family: 'Lato', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  letter-spacing: 0.5px;
  transition: all 0.18s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brown), var(--gold));
  color: #fff;
  box-shadow: 0 2px 10px rgba(107,76,53,0.22);
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--brown);
}
.btn-outline:hover { background: var(--warm); }

.btn-ghost {
  background: transparent;
  color: #b09070;
  font-weight: 400;
  font-size: 0.85rem;
  padding: 8px 12px;
}
.btn-ghost:hover { color: var(--brown); }

.btn-danger {
  background: transparent;
  border: 1.5px solid #e5a0a0;
  color: var(--red);
}
.btn-danger:hover { background: #fff3f3; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* ── TABS ── */
.tabs {
  display: flex;
  gap: 4px;
  padding: 16px 32px 0;
  border-bottom: 2px solid #ecdec8;
  background: #fff;
}

.tab {
  padding: 10px 22px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #b09070;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  border: none;
  background: transparent;
  transition: all 0.18s;
  letter-spacing: 0.5px;
}

.tab.active {
  color: var(--gold);
  border-bottom: 2px solid var(--gold);
  background: rgba(201,151,58,0.06);
}

.tab:hover:not(.active) {
  color: var(--brown);
  background: var(--warm);
}

/* ── MAIN LAYOUT ── */
main {
  padding: 32px;
  max-width: 1300px;
  margin: 0 auto;
}

.section { display: none; }
.section.active { display: block; }

.sec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.sec-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--dark);
}

/* ── MEDIA GRID ── */
.grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.grid-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--dark);
}

.count-badge {
  background: var(--warm);
  color: var(--brown);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.media-item {
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--shadow);
  transition: transform 0.18s;
  background: var(--warm);
  aspect-ratio: 1;
}

.media-item:hover { transform: scale(1.03); }

.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-overlay {
  position: absolute;
  inset: 0;
  background: rgba(44,31,14,0.18);
  opacity: 0;
  transition: opacity 0.18s;
}

.media-item:hover .media-overlay { opacity: 1; }

.media-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 99px;
}

/* Admin media extras */
.media-item:hover .media-del { display: flex; }

.media-del {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #c0392b;
  display: none;
  align-items: center;
  justify-content: center;
}

.media-access-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(44,31,20,0.75);
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* PDF/DOC tile */
.doc-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 12px;
  gap: 8px;
}

.doc-tile .doc-icon { font-size: 2.8rem; }

.doc-tile .doc-name {
  font-size: 0.72rem;
  color: var(--brown);
  text-align: center;
  word-break: break-all;
  max-height: 40px;
  overflow: hidden;
}

/* ── EMPTY STATE ── */
.empty {
  text-align: center;
  padding: 64px 24px;
  color: #b09070;
}

.empty .ico {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty p { font-size: 0.95rem; }

.empty small {
  font-size: 0.82rem;
  margin-top: 8px;
  display: block;
}

/* ── LIGHTBOX ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,12,5,0.93);
  z-index: 999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox.show { display: flex; }

.lightbox img,
.lightbox video {
  max-width: 92vw;
  max-height: 82vh;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.lb-close {
  position: absolute;
  top: 20px;
  right: 28px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  opacity: 0.7;
}

.lb-close:hover { opacity: 1; }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  background: none;
  border: none;
  opacity: 0.6;
  padding: 12px;
}

.lb-nav:hover { opacity: 1; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

.lb-caption {
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
  margin-top: 14px;
}

/* ── USER TABLE ── */
.table-wrap {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 14px var(--shadow);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

th {
  background: var(--warm);
  padding: 14px 20px;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--brown);
  font-weight: 700;
}

td {
  padding: 14px 20px;
  border-bottom: 1px solid #f0e6d3;
  font-size: 0.92rem;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(201,151,58,0.04); }

.tag {
  display: inline-block;
  background: var(--warm);
  color: var(--brown);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  margin: 2px;
}

.empty-row td {
  text-align: center;
  color: #b09070;
  padding: 32px;
  font-style: italic;
}

/* ── MODAL ── */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,12,5,0.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-bg.show { display: flex; }

.modal {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  width: 480px;
  max-width: 95vw;
  box-shadow: 0 8px 48px var(--shadow);
  position: relative;
  animation: fadeUp 0.35s cubic-bezier(.22,1,.36,1) both;
}

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

.modal h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin-bottom: 24px;
  color: var(--dark);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #b09070;
}

.modal-close:hover { color: var(--dark); }

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ── FORM ── */
.form-row { margin-bottom: 18px; }

.form-row label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--brown);
  font-weight: 700;
  margin-bottom: 7px;
}

.form-row input {
  width: 100%;
  border: 1.5px solid #e4d9cc;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: 'Lato', sans-serif;
  color: var(--dark);
  background: var(--cream);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-row input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,151,58,0.13);
  background: #fff;
}

.err {
  color: var(--red);
  font-size: 0.83rem;
  margin-top: 16px;
  display: none;
}

.err.show { display: block; }

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--gold-light);
  border-radius: 18px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  background: rgba(201,151,58,0.04);
  transition: all 0.2s;
  margin-bottom: 28px;
  position: relative;
}

.upload-zone:hover,
.upload-zone.drag {
  border-color: var(--gold);
  background: rgba(201,151,58,0.09);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-zone .ico { font-size: 2.4rem; }

.upload-zone p {
  color: var(--brown);
  font-size: 0.95rem;
  margin-top: 8px;
}

.upload-zone small {
  color: #b09070;
  font-size: 0.8rem;
}

/* ── ACCESS PANEL ── */
.access-panel {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 14px var(--shadow);
  margin-bottom: 28px;
}

.access-panel h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--dark);
}

.user-check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.user-check {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--warm);
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.user-check input[type="checkbox"] {
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.user-check.checked {
  background: rgba(201,151,58,0.18);
  border: 1.5px solid var(--gold);
}

.user-check span {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dark);
}

/* ── FILE QUEUE ── */
.queue-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--dark);
  margin-bottom: 16px;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.queue-item {
  background: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px var(--shadow);
}

.queue-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.queue-thumb img,
.queue-thumb video {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
}

.queue-info {
  flex: 1;
  min-width: 0;
}

.queue-info .q-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-info .q-access {
  font-size: 0.78rem;
  color: #b09070;
  margin-top: 3px;
}

.queue-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #c0392b;
  font-size: 1.1rem;
  opacity: 0.6;
}

.queue-remove:hover { opacity: 1; }

.upload-confirm-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--brown), var(--gold));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 18px rgba(107,76,53,0.25);
}

.upload-confirm-btn:hover { opacity: 0.9; transform: translateY(-1px); }

.upload-confirm-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ── INFO NOTES ── */
.info-note {
  background: rgba(201,151,58,0.1);
  border: 1px solid var(--gold-light);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--brown);
  margin-bottom: 20px;
}

/* ── WELCOME BANNER (gallery) ── */
.welcome-banner {
  background: linear-gradient(135deg, var(--brown), var(--gold));
  border-radius: 16px;
  padding: 24px 32px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  color: #fff;
}

.welcome-banner .wb-icon { font-size: 2.4rem; }

.welcome-banner h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
}

.welcome-banner p {
  font-size: 0.88rem;
  opacity: 0.85;
  margin-top: 4px;
}
