/* =============================================================================
   Camp Portal — Stylesheet
   Clean, warm, photo-forward design
   ============================================================================= */

:root {
  --cream: #faf8f4;
  --warm-white: #ffffff;
  --charcoal: #1a1a1a;
  --mid: #555;
  --light: #999;
  --border: #e8e4de;
  --accent: #c17b3a;
  --accent-dark: #9a5f28;
  --danger: #c0392b;
  --success: #27ae60;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --radius: 8px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ── */
.navbar {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--charcoal);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a { color: var(--mid); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--charcoal); text-decoration: none; }
.nav-admin { color: var(--accent) !important; }
.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--mid);
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  padding: 0;
}
.btn-link:hover { color: var(--charcoal); }

/* ── Main ── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  flex: 1;
  width: 100%;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.page-header h2 { font-size: 2rem; }
.subtitle { color: var(--light); font-size: 0.9rem; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; color: white; }
.btn-secondary { background: white; color: var(--charcoal); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--cream); text-decoration: none; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.85; text-decoration: none; color: white; }
.btn-full { width: 100%; text-align: center; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* ── Login ── */
.login-page {
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-container { width: 100%; max-width: 400px; padding: 24px; }
.login-card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 40px;
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-header h1 { font-size: 1.75rem; margin-bottom: 4px; }
.login-header p { color: var(--light); font-size: 0.9rem; }
.login-form { display: flex; flex-direction: column; gap: 20px; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--mid); }
.form-group input, .form-group select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  background: white;
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group small { color: var(--light); font-size: 0.8rem; }
.form-check label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.admin-form { max-width: 560px; display: flex; flex-direction: column; gap: 20px; }
.camper-checkboxes { display: flex; flex-direction: column; gap: 8px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.9rem; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c6; }
.alert-success { background: #eafaf1; color: var(--success); border: 1px solid #c3e6cb; }

/* ── Photo grid ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.photo-card {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--border);
  position: relative;
}
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.photo-download { display: block; width: 100%; height: 100%; position: relative; }
.photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.photo-card:hover .photo-overlay { opacity: 1; }
.photo-card:hover img { transform: scale(1.03); }
.download-icon { color: white; font-size: 1.5rem; font-weight: bold; }

/* ── Albums ── */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.album-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
  color: var(--charcoal);
}
.album-card:hover { transform: translateY(-2px); text-decoration: none; }
.album-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.album-placeholder { width: 100%; aspect-ratio: 4/3; background: var(--border); }
.album-info { padding: 16px; }
.album-info h3 { font-size: 1rem; margin-bottom: 4px; }
.album-info p { color: var(--light); font-size: 0.85rem; }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  color: var(--mid);
}

/* ── Admin ── */
.admin-grid { display: flex; flex-direction: column; gap: 40px; }
.admin-section { background: white; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.admin-section-header h3 { font-size: 1.1rem; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 12px 24px;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.admin-table th { color: var(--light); font-weight: 500; background: var(--cream); }
.admin-table tr:last-child td { border-bottom: none; }
.table-actions { display: flex; gap: 8px; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--light);
}

/* ── Error page ── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 16px;
  text-align: center;
  padding: 24px;
}
.error-page h1 { font-size: 3rem; }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  color: var(--light);
  font-size: 0.8rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .nav-links { gap: 12px; }
  .page-header { flex-direction: column; gap: 8px; }
}

/* ── Camper cards ── */
.camper-grid { display: flex; flex-direction: column; gap: 12px; max-width: 600px; }
.camper-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  color: var(--charcoal);
  transition: transform 0.15s;
}
.camper-card:hover { transform: translateX(4px); text-decoration: none; }
.camper-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.camper-info { flex: 1; }
.camper-info h3 { font-size: 1rem; margin-bottom: 2px; }
.camper-info p { color: var(--light); font-size: 0.85rem; }
.camper-arrow { color: var(--light); font-size: 1.2rem; }

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.lightbox-inner img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
}
.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}
.lightbox-actions { display: flex; gap: 12px; }
.zoom-icon { color: white; font-size: 1.2rem; }

/* ── Camper cover ── */
.camper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.camper-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--charcoal);
  transition: transform 0.15s;
  display: block;
}
.camper-card:hover { transform: translateY(-3px); text-decoration: none; }
.camper-cover {
  width: 100%;
  aspect-ratio: 1;
  background: var(--border);
  overflow: hidden;
}
.camper-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.camper-cover-placeholder {
  width: 100%;
  height: 100%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
}
.camper-info { padding: 14px 16px; }
.camper-info h3 { font-size: 1rem; }
