/* ===========================================
   THE FARM — IJSSELHOEVE DASHBOARD
   Modern Redesign 2026
   =========================================== */

/* --- VARIABELEN --- */
:root {
  --bg-primary: #F7F8FA;
  --bg-card: #FFFFFF;
  --bg-header: #1B2A3D;

  --text-primary: #1A1F2E;
  --text-secondary: #5A6170;
  --text-light: #8B91A0;
  --text-white: #FFFFFF;

  --accent: #4A7C8F;
  --accent-light: #6BA3B8;
  --accent-dark: #3A6575;
  --green: #5EAD73;
  --green-light: #7EC492;
  --amber: #D4956B;
  --blue: #5B8FAD;
  --red: #D06B5B;
  --purple: #7C6FA0;
  --teal: #5A9E8F;

  --warm-brown: #6B5D4F;
  --warm-dark: #2A2520;
  --warm-light: #C4BDB0;

  --border: #E8EBF0;
  --border-dark: #D0D4DC;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);

  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

/* --- DARK MODE --- */
.dark-mode {
  --bg-primary: #0F1219;
  --bg-card: #1A1F2E;
  --bg-header: #0A0E16;

  --text-primary: #E4E8F0;
  --text-secondary: #9AA0B0;
  --text-light: #5A6170;
  --text-white: #F0F2F8;

  --accent: #6BA3B8;
  --accent-light: #8BBDCE;
  --accent-dark: #4A8A9F;
  --green: #7EC492;
  --amber: #D4A87B;
  --blue: #7BAFC8;
  --red: #D08070;
  --purple: #9A8BB8;
  --teal: #7AAE9F;

  --border: #252A38;
  --border-dark: #303648;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.15);
  --shadow: 0 2px 12px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.35);
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===========================================
   HEADER — strak, modern
   =========================================== */

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-header);
  color: var(--text-white);
  padding: 0 32px;
  height: 56px;
  flex-shrink: 0;
}

.farm-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-light);
  letter-spacing: 0.3px;
}

.header-center { text-align: center; }

.clock {
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 3px;
  line-height: 1;
  color: var(--text-white);
}

.date {
  font-size: 12px;
  color: var(--warm-light);
  margin-top: 0;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.header-right { display: flex; align-items: center; }

.weather {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.08);
  padding: 6px 16px;
  border-radius: 100px;
}

.weather-icon { font-size: 22px; }
.weather-temp { font-size: 20px; font-weight: 600; }
.weather-desc { font-size: 11px; color: var(--warm-light); font-weight: 400; }

/* ===========================================
   MAIN GRID — 4 kolommen, geen energie
   =========================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.3fr;
  grid-template-rows: 1.1fr 0.9fr;
  gap: 12px;
  padding: 12px;
  flex: 1;
  min-height: 0;

  grid-template-areas:
    "schedule  roster     roster     slideshow"
    "schedule  todos      announce   bookings";
}

/* --- CARD BASIS --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  flex-shrink: 0;
}

.card-header h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: 0.2px;
}

.dark-mode .card-header h2 {
  color: var(--accent-light);
}

.card-body {
  padding: 10px 16px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  letter-spacing: 0.3px;
}

.badge-green { background: var(--green); }

/* --- GRID AREAS --- */
.card-slideshow    { grid-area: slideshow; }
.card-roster       { grid-area: roster; }
.card-schedule     { grid-area: schedule; }
.card-announcements { grid-area: announce; }
.card-bookings-prayer-wrapper { grid-area: bookings; display: flex; flex-direction: column; gap: 12px; }
.card-bookings-inner { flex: 1; min-height: 0; }
.card-prayer { flex: 1; min-height: 0; }
.card-todos        { grid-area: todos; }

/* Energy section (hidden/removed) */
.card-energy { display: none; }

/* ===========================================
   FOTO SLIDESHOW — groot & prominent
   =========================================== */

.card-slideshow {
  border: none;
  background: #000;
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.slideshow-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.slideshow-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slideshow-slide.active {
  opacity: 1;
}

.slideshow-photo-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.slideshow-bg-blur {
  position: absolute;
  inset: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  object-fit: cover;
  filter: blur(25px) brightness(0.5);
  z-index: 0;
}

.slideshow-photo-main {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  animation: ken-burns 16s ease-in-out forwards;
}

.slideshow-slide > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: ken-burns 16s ease-in-out forwards;
}

@keyframes ken-burns {
  0%   { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.05) translate(-0.5%, -0.5%); }
}

.slideshow-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 28px 18px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
  color: white;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.slideshow-countdown {
  text-align: center;
  color: white;
  padding: 40px;
}

.slideshow-countdown .countdown-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.slideshow-countdown .countdown-desc {
  color: rgba(255,255,255,0.65);
  margin-bottom: 16px;
  font-size: 14px;
}

.slideshow-countdown .countdown-number {
  font-size: 72px;
  font-weight: 800;
  color: var(--accent-light);
  line-height: 1;
}

.slideshow-countdown .countdown-label {
  font-size: 16px;
  color: rgba(255,255,255,0.55);
}

.slideshow-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.slideshow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: all 0.3s;
}

.slideshow-dot.active {
  background: var(--accent-light);
  width: 20px;
  border-radius: 3px;
}

/* ===========================================
   WEEKROOSTER
   =========================================== */

.roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.roster-table th {
  text-align: left;
  padding: 7px 10px;
  font-weight: 600;
  color: var(--accent-dark);
  border-bottom: 2px solid var(--border);
  font-size: 12px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dark-mode .roster-table th {
  color: var(--accent-light);
}

.roster-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.roster-table tr.current-week {
  background: linear-gradient(90deg, rgba(74,124,143,0.08), rgba(74,124,143,0.03));
}

.roster-table tr.current-week td {
  font-weight: 600;
}

.week-label {
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  font-size: 12px;
}

.current-week .week-label {
  color: var(--accent);
}

.week-previous {
  opacity: 0.4;
}

.roster-name {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 12px;
  background: rgba(74,124,143,0.08);
  color: var(--accent-dark);
  margin: 1px 2px;
  font-weight: 500;
}

.dark-mode .roster-name {
  background: rgba(107,163,184,0.12);
  color: var(--accent-light);
}

.roster-note {
  display: block;
  font-size: 10px;
  color: var(--amber);
  font-style: italic;
}

/* ===========================================
   WEEKPROGRAMMA
   =========================================== */

.schedule-day {
  margin-bottom: 10px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  border-left: 3px solid var(--border);
}

.schedule-day-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.schedule-day-name .day-date {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: none;
}

.schedule-event {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
}

.event-time {
  font-weight: 500;
  color: var(--text-light);
  white-space: nowrap;
  min-width: 40px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.event-name { flex: 1; }

.schedule-today {
  background: rgba(var(--accent-rgb, 74,144,226), 0.08);
  border-left: 3px solid var(--accent);
}

.schedule-today .schedule-day-name {
  color: var(--accent);
  font-weight: 800;
  font-size: 15px;
}

.schedule-today .schedule-day-name .day-date {
  color: var(--accent);
  opacity: 0.7;
}

.schedule-week-divider {
  border-top: 3px solid var(--border);
  margin: 14px 0 10px;
}

.card-schedule .card-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.event-category-worship    { border-left: 3px solid var(--purple); padding-left: 6px; border-radius: 2px; }
.event-category-chapel     { border-left: 3px solid var(--purple); padding-left: 6px; border-radius: 2px; }
.event-category-maaltijd   { border-left: 3px solid var(--amber); padding-left: 6px; border-radius: 2px; }
.event-category-klusdag    { border-left: 3px solid var(--red); padding-left: 6px; border-radius: 2px; }
.event-category-activiteit { border-left: 3px solid var(--blue); padding-left: 6px; border-radius: 2px; }

/* ===========================================
   MEDEDELINGEN
   =========================================== */

.announcement-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.announcement-item:last-child { border-bottom: none; }

.announcement-title {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
}

.announcement-item.priority .announcement-title { color: var(--red); }

.announcement-content {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.announcement-meta {
  font-size: 10px;
  color: var(--text-light);
}

.swap-request {
  background: rgba(212,149,107,0.06);
  border-radius: 8px;
  padding: 6px 10px;
  margin: 3px 0;
  font-size: 11px;
  border-left: 3px solid var(--amber);
}

/* ===========================================
   BOEKINGEN
   =========================================== */

.booking-room { margin-bottom: 6px; }

.room-name {
  font-weight: 600;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 100px;
  display: inline-block;
  margin-bottom: 3px;
}

.booking-entry {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 2px 0 2px 8px;
}

.booking-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.booking-status.free      { background: var(--green); }
.booking-status.booked    { background: var(--blue); }
.booking-status.confirmed { background: var(--blue); }
.booking-status.pending   { background: var(--amber); }

.booking-date {
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 52px;
  font-variant-numeric: tabular-nums;
}

.booking-info { color: var(--text-primary); }
.booking-person { color: var(--text-light); font-style: italic; }

/* ===========================================
   ENERGIE COMPETITIE (verborgen)
   =========================================== */

.energy-leaderboard,
.energy-unit,
.energy-streak,
.solar-summary { display: none; }

/* ===========================================
   FOOTER — strak, modern
   =========================================== */

.dashboard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-header);
  color: var(--text-white);
  padding: 8px 32px;
  height: 68px;
  flex-shrink: 0;
  gap: 28px;
}

.footer-left {
  flex: 1.8;
  min-width: 0;
  overflow: hidden;
}

.footer-verse {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.5;
}

.verse-text-inline {
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  color: rgba(255,255,255,0.85);
}

.verse-ref-inline {
  font-size: 11px;
  color: var(--accent-light);
  margin-left: 8px;
  font-weight: 600;
}

.footer-center {
  flex: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.footer-birthdays-section {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer-prayer-section {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  font-style: italic;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

.footer-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.footer-logo {
  height: 28px;
  width: auto;
  opacity: 0.65;
}

.footer-logo.dark { display: none; }

.dark-mode .footer-logo.light { display: none; }
.dark-mode .footer-logo.dark { display: inline; }

/* --- Dutch subtitle in card headers --- */
.header-dutch {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-light);
  margin-left: 3px;
}

/* ===========================================
   HELPERS
   =========================================== */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-light);
  font-size: 13px;
}

.no-data {
  color: var(--text-light);
  font-size: 12px;
  text-align: center;
  padding: 20px;
}

/* ===========================================
   TODO LIJST
   =========================================== */

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.todo-item:last-child { border-bottom: none; }

.todo-icon { font-size: 11px; min-width: 16px; text-align: center; }
.todo-text { flex: 1; }
.todo-category {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(74,124,143,0.08);
  color: var(--accent-dark);
  white-space: nowrap;
  font-weight: 500;
}

.dark-mode .todo-category {
  background: rgba(107,163,184,0.12);
  color: var(--accent-light);
}

.event-roster-info {
  font-size: 10px;
  color: var(--text-secondary);
  font-style: italic;
}

/* ===========================================
   GEBEDSPUNTEN PANEL
   =========================================== */

.prayer-item {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.4;
}

.prayer-item:last-child { border-bottom: none; }

.prayer-icon {
  font-size: 10px;
  margin-right: 4px;
}

.prayer-author {
  font-size: 9px;
  color: var(--text-light);
  font-style: italic;
}

/* ===========================================
   ADMIN PAGINA
   =========================================== */

body.admin-body {
  width: auto;
  height: auto;
  overflow: auto;
  background: var(--bg-primary);
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  display: block;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-header);
  color: var(--text-white);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.admin-header h1 {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--accent-light);
}

.admin-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.admin-nav button {
  padding: 8px 16px;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-nav button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-nav button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.admin-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: none;
}

.admin-section.active { display: block; }

.admin-section h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--warm-dark);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.admin-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-form.single-col { grid-template-columns: 1fr; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-body);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,124,143,0.12);
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-success { background: var(--green); color: white; }
.btn-danger { background: var(--red); color: white; }
.btn-secondary { background: var(--border-dark); color: var(--text-primary); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-dark);
  color: var(--text-secondary);
}
.btn-outline:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}
.btn-sm { padding: 4px 10px; font-size: 11px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  padding: 8px;
  background: rgba(74,124,143,0.05);
  font-weight: 600;
  color: var(--warm-dark);
  border-bottom: 2px solid var(--border-dark);
}

.admin-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.admin-table tr:hover { background: rgba(74,124,143,0.03); }

.admin-actions { display: flex; gap: 6px; }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.active { background: var(--green); }
.status-dot.inactive { background: var(--red); }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  background: var(--warm-dark);
  color: white;
  border-radius: var(--radius);
  font-size: 13px;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--red); }

.fairness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.fairness-card {
  padding: 12px;
  background: rgba(74,124,143,0.04);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.fairness-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.fairness-task { display: flex; justify-content: space-between; font-size: 12px; padding: 2px 0; }
.fairness-count { font-weight: 600; color: var(--accent); }

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (min-width: 1920px) {
  .roster-table { font-size: 14px; }
  .roster-table td { padding: 10px; }
  .schedule-event { font-size: 13px; }
  .announcement-title { font-size: 13px; }
  .todo-item { font-size: 13px; }
}

@media (min-width: 2560px) {
  html, body { font-size: 16px; }
  .roster-table { font-size: 15px; }
  .dashboard-grid { gap: 16px; padding: 16px; }
  .card-header { padding: 10px 20px; }
  .card-body { padding: 14px 20px; }
}

@media (max-width: 768px) {
  body.admin-body { padding: 10px; }
  .admin-form { grid-template-columns: 1fr; }
}
