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

:root {
  --primary: #7c1010;
  --primary-light: #a31818;
  --gold: #c9913a;
  --gold-light: #e8c06b;
  --dark: #1a1a1a;
  --surface: #fff;
  --surface2: #f7f3ef;
  --border: #e2d9d0;
  --text: #1e1e1e;
  --text-muted: #7a7068;
  --showpiste: #9b1b1b;
  --expohal: #1d4ed8;
  --lezingzaal: #15803d;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.09);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.16);
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--surface2); color: var(--text); min-height: 100vh; }

/* ===== HEADER ===== */
.site-header {
  background: linear-gradient(135deg, #5a0a0a 0%, var(--primary) 100%);
  color: white;
  padding: 0 24px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
  position: sticky; top: 0; z-index: 200;
}
.header-inner { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 62px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: white; }
.logo-icon { font-size: 26px; }
.logo-text { font-size: 20px; font-weight: 800; letter-spacing: .3px; }
.logo-sub { font-size: 10px; opacity: .7; letter-spacing: 1.2px; text-transform: uppercase; }
.header-nav { display: flex; align-items: center; gap: 10px; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: all .18s; }
.btn-ghost { background: rgba(255,255,255,.15); color: white; }
.btn-ghost:hover { background: rgba(255,255,255,.26); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-gold { background: var(--gold); color: white; }
.btn-gold:hover { background: var(--gold-light); color: #333; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* ===== EDITION + DAY TABS ===== */
.top-bar { background: white; border-bottom: 1px solid var(--border); }
.top-bar-inner { max-width: 1440px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.edition-select-wrap { padding: 10px 20px 10px 0; border-right: 1px solid var(--border); margin-right: 16px; }
.edition-select { font-size: 13px; font-weight: 700; border: 1.5px solid var(--border); border-radius: 6px; padding: 5px 10px; background: white; color: var(--text); cursor: pointer; }
.edition-select:focus { outline: none; border-color: var(--primary); }
.day-tabs { display: flex; gap: 0; }
.day-tab { padding: 14px 22px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; background: none; color: var(--text-muted); border-bottom: 3px solid transparent; margin-bottom: -1px; transition: all .2s; white-space: nowrap; }
.day-tab:hover { color: var(--primary); }
.day-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== SCHEDULE ===== */
.schedule-wrapper { max-width: 1440px; margin: 0 auto; padding: 24px; }
.venue-legend { display: flex; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text); }
.legend-dot { width: 13px; height: 13px; border-radius: 3px; }

/* Dagdeel block wrapper */
.dagdeel-block { margin-bottom: 28px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.dagdeel-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(90deg, var(--primary) 0%, #a31818 100%);
  color: white;
}
.dagdeel-name { font-size: 16px; font-weight: 800; letter-spacing: .3px; }
.dagdeel-time { font-size: 12px; opacity: .8; font-weight: 500; }

.schedule-container { background: white; overflow-x: auto; }
.schedule-grid {
  display: grid;
  grid-template-columns: 64px repeat(3, 1fr);
  min-width: 600px;
}

/* Column headers */
.col-header { padding: 12px 10px; font-weight: 700; font-size: 13px; text-align: center; color: white; border-bottom: 2px solid var(--border); }
.col-header.time-col { background: #2d2d2d; }
.col-header.venue-showpiste { background: var(--showpiste); }
.col-header.venue-expohal { background: var(--expohal); }
.col-header.venue-lezingzaal { background: var(--lezingzaal); }

.time-label { padding: 0 6px; display: flex; align-items: flex-start; justify-content: center; font-size: 10px; font-weight: 600; color: var(--text-muted); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #f9f9f9; min-height: 40px; padding-top: 5px; }
.venue-cell { position: relative; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-height: 40px; }
.venue-cell:last-child { border-right: none; }

/* Show blocks */
.show-block {
  position: absolute; left: 3px; right: 3px;
  border-radius: 6px; padding: 5px 7px;
  cursor: pointer; font-size: 11px; font-weight: 600;
  overflow: hidden; z-index: 2;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  line-height: 1.3;
}
.show-block:hover { transform: scale(1.02); box-shadow: 0 4px 16px rgba(0,0,0,.22); z-index: 5; }
.show-block.venue-showpiste { background: var(--showpiste); color: white; }
.show-block.venue-expohal { background: var(--expohal); color: white; }
.show-block.venue-lezingzaal { background: var(--lezingzaal); color: white; }
.show-block.is-hidden-public { background: #f0f0f0 !important; color: #999 !important; border: 1.5px dashed #ccc; font-style: italic; box-shadow: none; }
.show-block.is-hidden-admin { opacity: .65; border: 2px dashed rgba(255,255,255,.5); }
.show-time { font-size: 9px; opacity: .85; margin-bottom: 1px; }
.show-title { font-size: 11px; font-weight: 700; }

/* Empty dagdeel */
.dagdeel-empty { padding: 28px; text-align: center; color: var(--text-muted); font-size: 13px; font-style: italic; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(18px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.modal { background: white; border-radius: 14px; width: 100%; max-width: 500px; box-shadow: var(--shadow-lg); overflow: hidden; animation: slideUp .22s ease; }
.modal-header { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; }
.modal-venue-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; color: white; margin-bottom: 5px; }
.modal-title { font-size: 19px; font-weight: 800; color: var(--dark); }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); padding: 2px 4px; line-height: 1; }
.modal-close:hover { color: var(--dark); }
.modal-body { padding: 18px 22px 22px; }
.modal-photo { width: 100%; height: 200px; object-fit: cover; border-radius: 8px; margin-bottom: 14px; }
.modal-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
.modal-description { font-size: 14px; line-height: 1.65; color: var(--text); }

/* ===== EMBED NOTICE BOX ===== */
.embed-box { background: white; border: 1.5px solid var(--border); border-radius: 10px; padding: 20px 24px; margin-bottom: 28px; }
.embed-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.embed-code { background: #1e1e2e; color: #cdd6f4; font-family: 'Consolas', monospace; font-size: 12px; padding: 14px 16px; border-radius: 8px; overflow-x: auto; white-space: pre; }
.copy-btn { margin-top: 10px; }

/* ===== LOGIN ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a0505 0%, #5a0a0a 50%, #8b1212 100%); }
.login-card { background: white; padding: 46px 40px; border-radius: 16px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); text-align: center; }
.login-logo { font-size: 46px; margin-bottom: 8px; }
.login-title { font-size: 24px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.login-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 30px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 9px 13px; border: 1.5px solid var(--border); border-radius: 7px; font-size: 13px; color: var(--text); transition: border-color .2s; background: white; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,16,16,.08); }
.form-textarea { resize: vertical; min-height: 80px; }
.error-msg { color: #dc2626; font-size: 12px; margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-check { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; background: #fafafa; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; margin-top: 2px; flex-shrink: 0; }
.form-check-label { font-size: 13px; font-weight: 600; }
.form-check-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.photo-preview { width: 100%; max-height: 160px; object-fit: cover; border-radius: 7px; margin-top: 8px; display: none; }

/* ===== ADMIN LAYOUT ===== */
.admin-layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 62px); }
.admin-sidebar { background: #1a1a1a; color: white; padding: 20px 0; }
.sidebar-section { padding: 6px 18px; font-size: 10px; font-weight: 700; letter-spacing: 1px; color: rgba(255,255,255,.35); text-transform: uppercase; margin-top: 14px; }
.sidebar-link { display: flex; align-items: center; gap: 9px; padding: 9px 18px; color: rgba(255,255,255,.72); text-decoration: none; font-size: 13px; cursor: pointer; border: none; background: none; width: 100%; text-align: left; transition: all .15s; }
.sidebar-link:hover, .sidebar-link.active { background: rgba(255,255,255,.1); color: white; }
.sidebar-link .icon { font-size: 15px; width: 18px; }
.admin-main { padding: 26px; overflow-y: auto; background: var(--surface2); }
.admin-section { display: none; }
.admin-section.active { display: block; }

/* ===== TABLES ===== */
.card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-table { width: 100%; border-collapse: collapse; }
.card-table th { padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); background: #f9fafb; border-bottom: 1px solid var(--border); }
.card-table td { padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.card-table tr:last-child td { border-bottom: none; }
.card-table tr:hover td { background: #fdfaf8; }
.venue-badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; color: white; }
.venue-badge.showpiste { background: var(--showpiste); }
.venue-badge.expohal { background: var(--expohal); }
.venue-badge.lezingzaal { background: var(--lezingzaal); }
.actions { display: flex; gap: 6px; }
.toggle-btn { background: none; border: none; cursor: pointer; font-size: 18px; transition: transform .15s; }
.toggle-btn:hover { transform: scale(1.25); }

/* Dagdeel admin table */
.dagdeel-row { background: #f7f0ea; }
.dagdeel-row td { font-weight: 700; font-size: 12px; color: var(--primary); padding: 8px 14px; border-bottom: 1px solid var(--border); }

/* ===== PAGE TITLES ===== */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.page-title { font-size: 20px; font-weight: 800; }
.page-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ===== FORM CARD ===== */
.form-card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; max-width: 620px; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ===== EDITION MANAGEMENT ===== */
.edition-card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.edition-card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: linear-gradient(90deg, var(--primary), var(--primary-light)); color: white; }
.edition-card-title { font-size: 17px; font-weight: 800; }
.edition-card-body { padding: 16px 20px; }
.day-section { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.day-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.day-label { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.dagdeel-list { display: flex; flex-direction: column; gap: 6px; }
.dagdeel-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--surface2); border-radius: 6px; border: 1px solid var(--border); font-size: 13px; }
.dagdeel-item-name { font-weight: 700; }
.dagdeel-item-time { color: var(--text-muted); font-size: 12px; }

/* ===== FILTER BAR ===== */
.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-btn { padding: 5px 13px; border-radius: 6px; border: 1.5px solid var(--border); background: white; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== BADGES ===== */
.badge-hidden { display: inline-flex; align-items: center; gap: 4px; background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-visible { display: inline-flex; align-items: center; gap: 4px; background: #dcfce7; color: #166534; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }

/* ===== TOAST ===== */
.toast { position: fixed; bottom: 22px; right: 22px; background: #1a1a1a; color: white; padding: 11px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; z-index: 9999; box-shadow: var(--shadow-lg); animation: slideUp .28s ease; }
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }

/* ===== EMPTY ===== */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-icon { font-size: 40px; margin-bottom: 10px; }

/* ===== LIJSTMODUS ===== */
.show-list { padding: 8px 0; }

.show-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.show-list-item:last-child { border-bottom: none; }
.show-list-item:hover { background: #fdf8f4; }

.show-list-hidden { background: #f9f9f9; color: var(--text-muted); font-style: italic; }
.show-list-hidden:hover { background: #f3f3f3; }

.show-list-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
}

.show-list-venue-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.show-list-info { flex: 1; min-width: 0; }
.show-list-title { font-size: 15px; font-weight: 700; color: var(--text); }
.show-list-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.show-list-venue-label {
  font-size: 11px; font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  color: white;
  flex-shrink: 0;
  white-space: nowrap;
}
.show-list-item.venue-showpiste .show-list-venue-label { background: var(--showpiste); }
.show-list-item.venue-expohal .show-list-venue-label { background: var(--expohal); }
.show-list-item.venue-lezingzaal .show-list-venue-label { background: var(--lezingzaal); }
.show-list-hidden .show-list-venue-label { background: #ccc; color: #555; }

/* Admin list mode toggle pill */
.times-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px 4px 8px;
  border-radius: 20px;
  font-size: 12px; font-weight: 700;
  cursor: pointer; border: none;
  transition: all .18s;
}
.times-toggle.off { background: #fef3c7; color: #92400e; }
.times-toggle.off:hover { background: #fde68a; }
.times-toggle.on { background: #dcfce7; color: #166534; }
.times-toggle.on:hover { background: #bbf7d0; }

/* ===== EMBED PAGE ===== */
.embed-page-wrap { padding: 0; }
.embed-page-wrap .schedule-wrapper { padding: 16px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .schedule-wrapper { padding: 10px; }
  .top-bar-inner { padding: 0 12px; }
}
