* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --dark: #020617;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
}

/* ADMIN */

.admin-body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 35%),
    var(--bg);
  color: var(--text);
}

.admin-shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-header h1 {
  margin: 0;
  font-size: 34px;
}

.admin-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.lang-toggle {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.06);
  border-radius: 10px;
  padding: 3px;
}

.lang-btn {
  width: auto;
  margin: 0;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: 0.5px;
}

.lang-btn:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}

.lang-btn.active {
  background: white;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.display-link {
  background: var(--dark);
  color: white;
  text-decoration: none;
  padding: 13px 18px;
  border-radius: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 16px;
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 10px 0 2px;
}

.form-label:first-child {
  margin-top: 2px;
}

input,
textarea,
button {
  width: 100%;
  margin: 7px 0;
  padding: 12px 13px;
  border-radius: 13px;
  border: 1px solid var(--border);
  font-size: 15px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--primary);
}

button {
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--primary-dark);
}

.content-panel {
  margin-top: 18px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title span {
  color: var(--muted);
  font-size: 14px;
}

.items-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f9fafb;
}

.item-title {
  font-weight: 800;
}

.item-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.item button {
  width: auto;
  min-width: 110px;
  margin: 0;
}

.item button.delete,
#logoRemoveBtn {
  background: var(--danger);
}

.item button.edit {
  background: var(--dark);
}

/* Aan/uit-knop: grijs zolang het item aan staat, blauw als uitnodiging
   om een uitgeschakeld item weer aan te zetten. */
.item button.toggle {
  background: var(--muted);
}

/* Ring rather than a background flash: .item.disabled paints its own background,
   and a competing background would fight it. loadItems rebuilds every row, so the
   element is always new and the animation restarts reliably on repeated clicks. */
@keyframes itemJustMoved {
  0%   { box-shadow: 0 0 0 3px var(--primary); }
  70%  { box-shadow: 0 0 0 3px var(--primary); }
  100% { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0); }
}

.item.just-moved {
  animation: itemJustMoved 1.8s ease-out;
}

.item.disabled {
  background: #f3f4f6;
  border-style: dashed;
}

.item.disabled .item-title,
.item.disabled .item-meta {
  opacity: 0.6;
}

.item.disabled button.toggle {
  background: var(--primary);
}

.edit-box {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 120px 2fr 120px;
  gap: 10px;
  margin-top: 10px;
}

/* Own full-width row rather than widening the grid template above: datetime-local
   inputs need visible labels, since that input type ignores placeholder. */
.schedule-fields {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.schedule-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.schedule-fields input {
  margin: 0;
}

.logo-preview {
  height: 44px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  background: #fff;
}

.status-bar {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.hidden {
  display: none;
}

/* DISPLAY */

.display-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 25;
  display: flex;
  align-items: center;
  padding: 0 28px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.display-company-logo {
  height: 36px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  margin-right: 14px;
}

.display-company-name {
  font-size: 20px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.3px;
}

.display-body {
  background: #020617;
  color: white;
  overflow: hidden;
}

#screen {
  width: 100vw;
  height: calc(100vh - 56px);
  margin-top: 56px;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.22), transparent 34%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.16), transparent 38%),
    #020617;
}

.slide {
  width: 100vw;
  height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.45s ease;
}

.slide img,
.slide video {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
  object-position: center center;
}

.slide iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.text-slide {
  max-width: 1200px;
  padding: 7vw;
  text-align: center;
}

.text-slide h1 {
  font-size: clamp(38px, 5vw, 86px);
  margin: 0 0 28px;
}

.text-slide div {
  font-size: clamp(28px, 4vw, 64px);
  line-height: 1.25;
}

.rss-slide {
  width: min(1500px, 92vw);
  max-height: 86vh;
  padding: 48px;
  border-radius: 34px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.rss-slide h1 {
  margin: 0 0 28px;
  font-size: clamp(34px, 4vw, 64px);
}

.rss-list {
  display: grid;
  gap: 16px;
}

.rss-item {
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
}

.rss-item strong {
  display: block;
  font-size: clamp(22px, 2vw, 34px);
  margin-bottom: 7px;
}

.rss-item p {
  margin: 0;
  color: #cbd5e1;
  font-size: clamp(16px, 1.3vw, 22px);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty,
.offline {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.empty h1,
.offline h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 82px);
}

.empty p,
.offline p {
  margin: 0;
  color: #cbd5e1;
  font-size: clamp(20px, 2vw, 32px);
}

.loader {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(1.015); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 1200px) {
  .admin-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .edit-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .admin-shell {
    padding: 16px;
  }

  .admin-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .item {
    grid-template-columns: 1fr;
  }

  .item button {
    width: 100%;
  }
}
.display-dots {
  position: fixed;
  left: 22px;
  bottom: 22px;
  display: flex;
  gap: 7px;
  z-index: 20;
  background: rgba(0,0,0,0.35);
  padding: 6px 10px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
}

.display-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.display-dot.active {
  background: rgba(255, 255, 255, 0.95);
}

.display-progress {
  position: fixed;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  z-index: 20;
  background: rgba(255, 255, 255, 0.12);
}

.display-progress-fill {
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.9);
}
.made-by {
  position: fixed;
  bottom: 18px;
  right: 22px;
  z-index: 100;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 20px;
  padding: 5px 14px;
  letter-spacing: 0.3px;
  pointer-events: none;
}

.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(245, 247, 251, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pin-box {
  width: 420px;
  max-width: 100%;
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.pin-box h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.pin-box p {
  margin: 0 0 14px;
  color: var(--muted);
}

.pin-error {
  min-height: 22px;
  margin-top: 8px;
  color: var(--danger);
  font-size: 14px;
}

.display-datetime {
  position: fixed;
  right: 18px;
  top: 12px;
  z-index: 30;
  color: rgba(255,255,255,0.92);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  font-family: Inter, Arial, sans-serif;
  background: rgba(0,0,0,0.35);
  padding: 4px 10px;
  border-radius: 10px;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
