/* =========================
   Uit in Ekeren — styles.css
   Geconsolideerde, opgeschoonde versie
   ========================= */

/* ===== Kleuren & basis ===== */
:root{
  --blue:#0057B8; --blue-2:#003f86; --yellow:#FFD200;
  --bg:#f6f8fb; --ink:#0f172a; --muted:#667085; --line:#e6e9ef;
  --rounded:18px; --shadow:0 12px 26px rgba(15,23,42,.08);

  /* Badge voor aantal events */
  --event-badge-bg:#0057B8; --event-badge-ink:#ffffff;
}

*{ box-sizing:border-box; }
html,body{
  margin:0; height:100%;
  background:var(--bg); color:var(--ink);
  font:16px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial;
}
a{ color:inherit; text-decoration:none; }
.app{ min-height:100svh; display:grid; grid-template-rows:auto 1fr; }

/* ===== Top header ===== */
.topbar{
  position:sticky; top:0; z-index:10;
  padding:16px clamp(12px,3vw,28px);
  background:linear-gradient(90deg,var(--blue) 0%, var(--blue-2) 100%);
  color:white; box-shadow:0 10px 30px rgba(0,0,0,.08);
}
.top-inner{ max-width:1200px; margin-inline:auto; position:relative; min-height:44px; }
.site-badge{
  position:absolute; left:0; top:0; transform:translateY(-4px);
  display:inline-flex; align-items:center; gap:10px;
  background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.35);
  padding:8px 12px; border-radius:999px; font-weight:900; backdrop-filter:blur(6px);
}
.site-badge .logo{ width:28px; height:28px; border-radius:6px; object-fit:cover; box-shadow:0 2px 8px rgba(0,0,0,.25); background:#fff; }
.nav{ display:flex; gap:12px; justify-content:right; margin-top:6px; }
.nav a{
  background:white; color:#18233d; border:1px solid #dbe1f1;
  padding:10px 16px; border-radius:12px; font-weight:800;
  box-shadow:0 6px 14px rgba(0,0,0,.06);
  transition:transform .12s ease, box-shadow .12s ease;
}
.nav a:is(:hover,:focus){ transform:translateY(-1px); outline:0; box-shadow:0 10px 20px rgba(0,0,0,.10); }
.nav a[aria-current="page"]{ border-color:#c7d6ff; }

/* ===== Layout (grid-areas) ===== */
.layout{
  display:grid; gap:20px;
  grid-template-columns:260px 1fr 260px;
  grid-template-areas:"info center ads";
  padding:20px; max-width:1200px; margin-inline:auto; width:100%;
}
.info-panel{ grid-area:info; position:sticky; top:20px; align-self:start;
  background:linear-gradient(180deg,#EAF3FF 0%, #FFF7CC 100%); border:1px solid #dfe8fb; }
.center{ grid-area:center; display:grid; gap:16px; }
.ads-panel{ grid-area:ads; display:grid; gap:16px; position:sticky; top:20px; align-self:start; }
.panel{ background:#fff; border:1px solid var(--line); border-radius:var(--rounded); box-shadow:var(--shadow); padding:16px; }
.panel h3{ margin:.2rem 0 .6rem; font-size:1.05rem; }
.ad{
  display:grid; place-items:center; aspect-ratio:1/1; background:#fff;
  border:3px dashed var(--yellow); border-radius:12px; font-weight:900; letter-spacing:.04em; color:#3a3a3a;
  box-shadow:0 6px 14px rgba(0,0,0,.04);
}

/* ===== Kalender ===== */
.calendar{
  background:#fff; border:1px solid var(--line); border-radius:var(--rounded);
  box-shadow:var(--shadow); padding:12px 12px 16px; border-top:4px solid var(--yellow);
}
.cal-head{ display:flex; align-items:center; justify-content:space-between; padding:8px 6px 12px; }
.cal-title{ font-weight:900; text-transform:capitalize; display:flex; gap:8px; }
.cal-title select{ border:1px solid #dbe1f1; border-radius:10px; padding:6px 10px; background:#fff; font-weight:700; }
.cal-nav{ display:flex; gap:8px; }
.btn{
  border:2px solid var(--blue); background:linear-gradient(180deg,#ffffff 0%, #f7fbff 100%);
  color:#0f2440; border-radius:10px; padding:6px 12px; cursor:pointer; font-weight:900;
}
.btn:hover{ background:#f0f6ff; }

.grid{ display:grid; gap:6px; grid-template-columns:repeat(7,1fr); }
.dow{ font-size:.82rem; color:var(--muted); text-align:center; padding:6px 0; }
.cell{
  border:1px solid #edf0f6; border-radius:12px; min-height:70px; padding:6px;
  display:flex; align-items:flex-start; justify-content:flex-end; position:relative; background:#fff;
  transition:transform .08s ease, box-shadow .08s ease, background .08s ease;
}
.cell.wknd{ background:#FFF6CC; }
.cell.out{ background:#f0f5ff; color:#9aa3b2; }
.cell.btnish{ cursor:pointer; }
.cell.btnish:hover{ box-shadow:0 0 0 2px #E3F0FF inset; }
.cell.btnish:focus-visible{ outline:3px solid var(--yellow); outline-offset:2px; }
.daynum{ font-size:.92rem; font-weight:800; color:#0b2440; }
.cell.out .daynum{ color:#8da2c0; }
.daynum.is-today{ background:var(--yellow); color:#00224d; padding:2px 6px; border-radius:8px; }
.cell.has-events::after{
  content: attr(data-count);
  position:absolute; left:8px; bottom:8px; min-width:24px; height:24px; padding:0 7px;
  display:grid; place-items:center; font-size:.78rem; font-weight:900;
  color: var(--event-badge-ink); background: var(--event-badge-bg);
  border:2px solid #ffffff; border-radius:999px; box-shadow:0 4px 10px rgba(0,0,0,.18);
}
.cell.sel{ outline:4px solid rgba(0,87,184,.5); box-shadow:0 0 0 2px #ffffff,inset 0 0 0 999px rgba(0,87,184,.06); }

/* ===== Events tabel ===== */
.events{ background:#fff; border:1px solid var(--line); border-radius:var(--rounded); box-shadow:var(--shadow); overflow:auto; }
.events-head{ padding:8px 12px; }
.events-title{ margin:0; font-size:1.05rem; }
table{ border-collapse:collapse; width:100%; }
thead th{
  position:sticky; top:0;
  background:linear-gradient(180deg,#fff 0%, #FFF4B8 100%);
  border-bottom:2px solid var(--yellow); text-align:left; font-size:.92rem; padding:10px;
  box-shadow:0 2px 0 rgba(0,0,0,.04);
}
tbody td{ border-top:1px solid #eef1f7; padding:10px; font-size:.95rem; vertical-align:middle; }
tbody tr:nth-child(odd){ background:#f9fbff; }
.empty{ padding:16px; color:#6b778c; }
.legend{ display:flex; gap:12px; align-items:center; color:#6b778c; font-size:.88rem; margin:6px 4px 0; }
.swatch{ width:12px; height:12px; border-radius:4px; display:inline-block; border:1px solid #dbe1f1; }
.swatch-count{ background: var(--event-badge-bg); border:1px solid #dbe1f1; }

/* Affiche/thumb + linkknop */
.poster{ width:68px; height:48px; object-fit:cover; border-radius:8px; border:1px solid #e2e8f0; box-shadow:0 2px 8px rgba(0,0,0,.05); }
.poster-link{ display:inline-block; line-height:0; }
.poster--empty{
  width:68px; height:48px; border-radius:8px; border:1px dashed #cbd5e1;
  display:grid; place-items:center; color:#94a3b8; font-size:.8rem; background:#f8fafc;
}
.link-btn{
  display:inline-flex; align-items:center; gap:8px; padding:8px 12px;
  border-radius:10px; font-weight:800; border:2px solid var(--blue); background:#fff;
}
.link-btn:hover{ background:#f0f6ff; }
.link-btn:active{ transform:translateY(1px); }

/* ===== Admin bar & knoppen ===== */
.admin-bar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px 16px; border:1px dashed var(--line);
}
.admin-bar .admin-left{ display:flex; gap:10px; align-items:center; }
.muted{ color: var(--muted); font-size:.92rem; }

.btn-blue{ border:2px solid var(--blue); background:#fff; font-weight:900; }
.btn-blue:hover{ background:#f0f6ff; }
.btn-green{ border:2px solid #16a34a; background:#fff; font-weight:900; }
.btn-green:hover{ background:#ecfdf5; }
.btn-outline{ border:2px solid #cbd5e1; background:#fff; font-weight:800; }
.btn-outline:hover{ background:#f8fafc; }

/* ===== Modal ===== */
.modal{
  position:fixed; inset:0; display:none; place-items:center;
  background:rgba(2,6,23,.45); z-index:50; padding:20px;
}
.modal[open]{ display:grid; }
.modal__dialog{
  width:min(720px, 96vw); background:#fff; color:var(--ink);
  border-radius:16px; border:1px solid var(--line); box-shadow:var(--shadow);
  padding:0; overflow:hidden;
}
.modal__head{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; border-bottom:1px solid var(--line); background:#f8fafc;
}
.modal__close{
  border:1px solid #e2e8f0; background:#fff; border-radius:10px; padding:6px 10px; cursor:pointer;
}
.form{ padding:16px; display:grid; gap:12px; }
.form__row{ display:grid; gap:6px; }
.form__row:has(input[type="date"]), .form__row:has(input[type="time"]){
  grid-template-columns: 1fr 1fr; gap:12px;
}
.form__row input, .form__row textarea{
  border:1px solid #dbe1f1; border-radius:10px; padding:10px; font:inherit; background:#fff;
}
.form__row textarea{ resize:vertical; }
.form__actions{ display:flex; gap:10px; justify-content:flex-end; align-items:center; }
.file-label input[type="file"]{ display:block; margin-top:6px; }
.poster-preview{ min-height:48px; display:flex; align-items:center; }
.poster-preview img{ width:120px; height:auto; border-radius:10px; border:1px solid #e2e8f0; box-shadow:0 2px 8px rgba(0,0,0,.06); }

/* Tabel – actieskolom */
table .actions{ white-space:nowrap; }
table .icon-btn{
  border:1px solid #2563eb; background:#fff; color:#1d4ed8;
  padding:6px 10px; border-radius:8px; font-weight:800; cursor:pointer;
}
table .icon-btn:hover{ background:#eff6ff; }

/* ===== Ads (house) ===== */
.ads-panel { gap:16px; }
.adslot{
  min-height:250px; background:#fff; border:1px dashed #e5e7eb; border-radius:12px;
}

/* ===== Info-toggle (default verborgen op desktop) ===== */
.info-toggle{ display:none; }

/* ===== Responsive ===== */

/* Header tweaks */
@media (max-width: 980px){
  .site-badge{ position:static; display:inline-flex; margin-bottom:8px; transform:none; }
  .topbar{ padding-top:52px; }
}

/* Mobile layout: volgorde = TOGGLE → INFO → CENTER → ADS; info bovenaan, niet-sticky */
@media (max-width: 980px){
  .layout{
    grid-template-columns:1fr;
    grid-template-areas:
      "toggle"
      "info"
      "center"
      "ads";
  }
  .info-panel{ grid-area:info; position:static; top:auto; padding:12px; border-radius:12px; background:#fff; }
  .ads-panel{ grid-area:ads; position:static; top:auto; }
  .info-toggle{
    grid-area:toggle;
    display:block;
    border:2px solid #dbe1f1; background:#fff; color:#0f2440;
    border-radius:12px; padding:10px 12px; font-weight:900;
  }
  /* inklapbaar gedrag: JS zet [hidden] */
  #infoPanel[hidden]{ display:none !important; }
}

/* Kalenderraster compacter + tabel scroll */
@media (max-width: 620px){
  .layout{ padding:12px; }
  .cal-head{ flex-wrap:wrap; gap:8px; }
  .cal-nav{ order:2; width:100%; justify-content:space-between; }
  .cal-title{ order:1; width:100%; }
  .cal-title select{ flex:1; width:50%; }

  .grid{ gap:4px; }
  .cell{ min-height:56px; border-radius:10px; }
  .daynum{ font-size:.9rem; }

  .events{ overflow-x:auto; }
  .events table{ min-width: 680px; } /* leesbare kolommen op smal scherm */
}

@media (max-width: 400px){
  .cell{ min-height:50px; }
  .daynum{ font-size:.85rem; }
  .legend{ font-size:.8rem; gap:8px; }
}

/* ===== Dark mode ===== */
@media (prefers-color-scheme: dark){
  :root{ --bg:#0b1220; --ink:#e9eefb; --muted:#a8b3cf; --line:#1a2236; }
  .panel,.calendar,.events{ background:#0e1628; }
  .cell{ background:#0f1a31; border-color:#1e2a46; }
  .cell.out{ background:#0b1630; color:#7c88a6; }
  .cell.wknd{ background:#332d09; }
  .dow{ color:#97a3c0; }
  thead th{ background:linear-gradient(180deg,#0e1628 0%, #3b3200 100%); border-bottom-color:#a38600; }
  .ad{ background:#0c1730; border-color:#a38600; }
  .poster{ border-color:#26324a; }
  .poster--empty{ border-color:#33415e; background:#0f1a31; color:#7b8ab0; }
  .link-btn{ background:#0f1a31; border-color:#2a4b86; }
  .link-btn:hover{ background:#0d1630; }
  .modal__dialog{ background:#0e1628; color:#e9eefb; }
  .modal__head{ background:#0f1a31; border-bottom-color:#1a2236; }
  .form__row input, .form__row textarea{ background:#0f1a31; border-color:#26324a; color:#e9eefb; }
  .poster-preview img{ border-color:#26324a; }
  .adslot{ background:#0e1628; border-color:#2a3a66; }
}
