/* ── ELA-Paging · Silbersee II Haltern am See · Corporate Design ──────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Silbersee II Brandfarben */
  --water-deep:   #071e2e;   /* Tiefwasser – Haupt-BG */
  --water-mid:    #0d2a3d;   /* Mittelwasser – Card BG */
  --water-light:  #143348;   /* Seichtwasser – Card 2 */
  --border:       #1e3f55;   /* Ufer */
  --teal:         #0B8CA8;   /* Primärfarbe – Seewasser */
  --teal-light:   #7EBEC5;   /* Akzentfarbe – Reflexion */
  --teal-dark:    #076d85;
  --silver:       #B8C4C8;   /* Silbersand */
  --silver-dim:   #7a8f99;
  --white:        #e8f4f8;
  --text:         #daedf5;
  --text-dim:     #7a9aaa;
  --green:        #22c55e;
  --red:          #ef4444;
  --orange:       #f97316;
  --yellow:       #eab308;
  --btn-h:        50px;
  --radius:       12px;
  --shadow:       0 4px 24px rgba(0,0,0,.5);
  --wave-shadow:  0 2px 16px rgba(11,140,168,.2);
}

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

html, body {
  height: 100%;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--water-deep);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

/* ── Hintergrundbild ─────────────────────────────────────────────────── */
body {
  background-image: url('https://www.rvr.ruhr/fileadmin/user_upload/01_RVR_Home/01_Politik_Regionalverband/Ueber_uns/Beteiligungen/Fotos/Silbersee_Haltern-epa_Bilder_Friedemann_Vogel.jpeg');
  background-size: cover;
  background-position: center 40%;
  background-attachment: fixed;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background: rgba(7,30,46,.88);
  pointer-events: none;
  z-index: 0;
}
#app-shell { position: relative; z-index: 1; }

/* ── Statusbar ────────────────────────────────────────────────────────── */
#statusbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  height: 58px;
  background: rgba(7,30,46,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--wave-shadow);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.brand-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(11,140,168,.4);
}
.brand-text {
  display: flex; flex-direction: column; line-height: 1.1;
}
.brand-name {
  font-size: 15px; font-weight: 700;
  color: var(--white); letter-spacing: .3px;
}
.brand-sub {
  font-size: 10px; font-weight: 400;
  color: var(--teal-light); letter-spacing: 1px;
  text-transform: uppercase;
}

#status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
  box-shadow: 0 0 6px var(--green);
  transition: all .3s;
}
#status-dot.active { background: var(--red); box-shadow: 0 0 8px var(--red); animation: pulse 1s infinite; }
#status-dot.live   { background: var(--orange); box-shadow: 0 0 8px var(--orange); animation: pulse .6s infinite; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

#status-text { flex: 1; font-size: 13px; color: var(--text-dim); }

#stop-btn {
  display: none; padding: 5px 14px;
  background: var(--red); border: none; border-radius: 8px;
  color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 8px rgba(239,68,68,.3);
}
#stop-btn.visible { display: block; }

#user-label { font-size: 12px; color: var(--text-dim); }

/* ── Tabs ─────────────────────────────────────────────────────────────── */
#tabs {
  display: flex;
  background: rgba(13,42,61,.8);
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
  position: relative; z-index: 10;
}
#tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 1; min-width: 80px;
  padding: 14px 8px 12px;
  background: none; border: none;
  color: var(--text-dim);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all .2s;
  white-space: nowrap;
  font-family: inherit;
}
.tab-btn:hover { color: var(--teal-light); }
.tab-btn.active {
  color: var(--teal-light);
  border-bottom-color: var(--teal);
}

/* ── Container ───────────────────────────────────────────────────────── */
.tab-content { display: none; padding: 20px 16px; max-width: 740px; margin: 0 auto; }
.tab-content.active { display: block; }

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--water-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.card:focus-within::before { opacity: 1; }

.card h3 {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--teal-light);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
}

/* ── Form elements ───────────────────────────────────────────────────── */
textarea, input[type=text], input[type=time], input[type=password], select {
  width: 100%;
  background: var(--water-light);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea:focus, input:focus, select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(11,140,168,.15);
}
textarea { resize: vertical; min-height: 110px; }

select option { background: var(--water-mid); }

/* Browser-Autofill überschreiben */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--water-light) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  border: 1px solid var(--border) !important;
}

.char-count {
  text-align: right; font-size: 12px; color: var(--text-dim);
  margin-top: 5px;
}
.char-count.warn { color: var(--orange); }
.char-count.over { color: var(--red); }

label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--silver-dim);
  margin-bottom: 7px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--btn-h); padding: 0 22px;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s, transform .1s, box-shadow .2s;
  user-select: none;
  letter-spacing: .2px;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  box-shadow: 0 3px 12px rgba(11,140,168,.35);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 4px 18px rgba(11,140,168,.5); }

.btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 3px 12px rgba(34,197,94,.3);
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 3px 12px rgba(239,68,68,.3);
}
.btn-ghost {
  background: var(--water-light);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--teal); color: var(--teal-light); }

.btn-full { width: 100%; }

/* ── PTT-Taste ───────────────────────────────────────────────────────── */
#ptt-btn {
  width: 100%; height: 88px;
  border-radius: 14px;
  font-size: 17px; font-weight: 600; letter-spacing: .5px;
  background: var(--water-light);
  border: 2px solid var(--border);
  color: var(--text);
  transition: all .2s;
  font-family: inherit;
  cursor: pointer;
}
#ptt-btn:hover { border-color: var(--teal); color: var(--teal-light); }
#ptt-btn.recording {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 0 24px rgba(239,68,68,.4);
  animation: pulse .9s infinite;
}

/* ── Zonen ───────────────────────────────────────────────────────────── */
.zones-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.zone-chip {
  padding: 12px 6px;
  border-radius: 9px;
  background: var(--water-light);
  border: 2px solid var(--border);
  color: var(--text-dim);
  text-align: center;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all .2s;
}
.zone-chip:hover { border-color: var(--teal); color: var(--teal-light); }
.zone-chip.active {
  border-color: var(--teal);
  background: rgba(11,140,168,.18);
  color: var(--teal-light);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(11,140,168,.2);
}

/* ── Bibliothek ──────────────────────────────────────────────────────── */
#search-bar { display: flex; gap: 8px; margin-bottom: 12px; }
#search-bar input { flex: 1; }

.file-list { display: flex; flex-direction: column; gap: 8px; }

.file-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--water-mid);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  transition: border-color .2s;
}
.file-item:hover { border-color: rgba(11,140,168,.4); }

.file-info { flex: 1; min-width: 0; }
.file-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta  { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.file-actions { display: flex; gap: 6px; flex-shrink: 0; }
.file-actions button {
  padding: 7px 11px; border-radius: 7px;
  border: none; cursor: pointer;
  font-size: 13px; font-weight: 500;
  font-family: inherit;
  background: var(--water-light); color: var(--text);
  transition: all .15s;
}
.file-actions button.play {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
}
.file-actions button.del {
  background: rgba(239,68,68,.15);
  color: var(--red);
  border: 1px solid rgba(239,68,68,.2);
}
.file-actions button.del:hover { background: var(--red); color: #fff; }

audio {
  width: 100%; border-radius: 6px; margin-top: 8px;
  height: 32px;
  accent-color: var(--teal);
}

/* ── Upload-Zone ─────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--text-dim);
  cursor: pointer;
  transition: all .2s;
}
.upload-zone:hover {
  border-color: var(--teal);
  background: rgba(11,140,168,.05);
  color: var(--teal-light);
}
.upload-zone p { font-size: 14px; }

/* ── Zeitpläne ───────────────────────────────────────────────────────── */
.schedule-item {
  background: var(--water-mid);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 14px;
  margin-bottom: 8px;
  transition: border-color .2s;
}
.schedule-item:hover { border-color: rgba(11,140,168,.4); }
.schedule-header { display: flex; align-items: center; gap: 8px; }
.schedule-title  { flex: 1; font-weight: 600; font-size: 14px; }
.schedule-meta   { font-size: 12px; color: var(--text-dim); margin-top: 5px; }

.badge {
  display: inline-block; padding: 3px 9px;
  border-radius: 20px; font-size: 11px; font-weight: 600;
  letter-spacing: .4px;
}
.badge-active   { background: rgba(34,197,94,.15); color: var(--green); border: 1px solid rgba(34,197,94,.25); }
.badge-inactive { background: rgba(122,154,170,.12); color: var(--text-dim); border: 1px solid var(--border); }

/* ── Log ─────────────────────────────────────────────────────────────── */
.log-entry {
  display: flex; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px; align-items: baseline;
}
.log-ts     { color: var(--text-dim); white-space: nowrap; flex-shrink: 0; font-size: 12px; }
.log-action { font-weight: 600; flex-shrink: 0; color: var(--teal-light); min-width: 80px; }
.log-detail { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Login-Overlay ───────────────────────────────────────────────────── */
#app-shell { display: none; }
#app-shell.visible { display: block; }

#login-overlay {
  display: flex;
  position: fixed; inset: 0;
  background-image: url('https://www.rvr.ruhr/fileadmin/user_upload/01_RVR_Home/01_Politik_Regionalverband/Ueber_uns/Beteiligungen/Fotos/Silbersee_Haltern-epa_Bilder_Friedemann_Vogel.jpeg');
  background-size: cover;
  background-position: center 40%;
  z-index: 999;
  align-items: center; justify-content: center;
}
#login-overlay::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    160deg,
    rgba(7,30,46,.82) 0%,
    rgba(7,30,46,.65) 50%,
    rgba(11,140,168,.25) 100%
  );
}
.login-box { position: relative; z-index: 1; }
#login-overlay.hidden { display: none; }

/* ── Benutzerverwaltung ──────────────────────────────────────────────── */
.user-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--water-light);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  margin-bottom: 8px;
  transition: border-color .2s;
}
.user-item:hover { border-color: rgba(11,140,168,.4); }
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 15px; }
.user-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.user-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.user-actions button {
  padding: 6px 10px; border-radius: 7px;
  border: none; cursor: pointer; font-size: 12px; font-weight: 500;
  font-family: inherit; transition: all .15s;
}
.btn-role   { background: rgba(11,140,168,.15); color: var(--teal-light); border: 1px solid rgba(11,140,168,.3) !important; }
.btn-pw     { background: rgba(234,179,8,.12); color: var(--yellow); border: 1px solid rgba(234,179,8,.25) !important; }
.btn-toggle { background: rgba(139,146,169,.12); color: var(--text-dim); border: 1px solid var(--border) !important; }
.btn-toggle.active { background: rgba(34,197,94,.12); color: var(--green); border-color: rgba(34,197,94,.25) !important; }
.btn-del-user { background: rgba(239,68,68,.12); color: var(--red); border: 1px solid rgba(239,68,68,.2) !important; }
.btn-del-user:hover { background: var(--red); color: #fff; }

.role-badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
}
.role-admin    { background: rgba(11,140,168,.2); color: var(--teal-light); }
.role-operator { background: rgba(139,146,169,.15); color: var(--text-dim); }

.login-box {
  background: var(--water-mid);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px 36px;
  width: min(92%, 400px);
  box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(11,140,168,.1);
}

.login-logo {
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.login-logo .icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  box-shadow: 0 8px 24px rgba(11,140,168,.4);
}
.login-logo h1 {
  font-size: 20px; font-weight: 700; text-align: center;
  color: var(--white);
}
.login-logo .tagline {
  font-size: 12px; color: var(--teal-light);
  text-transform: uppercase; letter-spacing: 1.5px;
  text-align: center;
}

.login-box .form-group { margin-bottom: 14px; }
.login-box .btn { margin-top: 20px; height: 52px; font-size: 16px; }

.login-footer {
  text-align: center; margin-top: 20px;
  font-size: 11px; color: var(--text-dim);
}

/* ── Powered by Bideon – Login ───────────────────────────────────────── */
.powered-by {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.powered-by span {
  font-size: 10px; color: var(--text-dim); letter-spacing: .06em;
  text-transform: uppercase; white-space: nowrap;
}
.powered-by .bideon-logo {
  height: 48px; width: auto; opacity: 0.75;
  transition: opacity .2s;
}
.powered-by:hover .bideon-logo { opacity: 1; }

/* ── App-Footer ──────────────────────────────────────────────────────── */
#app-footer {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 18px 20px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  background: rgba(7,30,46,.6);
}
#app-footer span {
  font-size: 11px; color: var(--text-dim); letter-spacing: .08em;
  text-transform: uppercase;
}
#app-footer img {
  height: 36px; width: auto; opacity: 0.65;
  transition: opacity .2s;
}
#app-footer:hover img { opacity: 1; }

/* ── Divider ─────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* ── Checkbox-Row ────────────────────────────────────────────────────── */
.check-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
}
.check-row input[type=checkbox] {
  width: 18px; height: 18px; accent-color: var(--teal);
  cursor: pointer;
}

/* ── Toggle-Switch ───────────────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { display: none; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--water-light); border-radius: 24px;
  border: 1px solid var(--border); transition: all .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; top: 2px;
  background: var(--text-dim); border-radius: 50%;
  transition: transform .2s;
}
.toggle input:checked + .toggle-slider {
  background: var(--teal); border-color: var(--teal);
  box-shadow: 0 0 8px rgba(11,140,168,.3);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px); background: #fff;
}

/* ── Toasts ──────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 1000;
}
.toast {
  background: var(--water-mid);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 18px;
  font-size: 14px; max-width: 320px;
  box-shadow: var(--shadow);
  animation: slide-in .25s ease;
  font-family: inherit;
}
.toast.success { border-color: rgba(34,197,94,.4); color: var(--green); }
.toast.error   { border-color: rgba(239,68,68,.4); color: var(--red); }

@keyframes slide-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(7,30,46,.75);
  backdrop-filter: blur(6px);
  z-index: 500; align-items: center; justify-content: center;
}
.modal-overlay.visible { display: flex; }
.modal {
  background: var(--water-mid);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 28px;
  width: min(95%, 500px); max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.modal h3 { margin-bottom: 18px; font-size: 17px; color: var(--white); }
.modal .form-group { margin-bottom: 14px; }
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px;
}

.days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.day-chip {
  padding: 7px 2px; text-align: center; border-radius: 7px;
  background: var(--water-light); border: 1px solid var(--border);
  font-size: 12px; font-weight: 500; cursor: pointer; user-select: none;
  transition: all .15s;
}
.day-chip.active {
  background: rgba(11,140,168,.2);
  border-color: var(--teal);
  color: var(--teal-light);
}

/* ── Voiceover save row ──────────────────────────────────────────────── */
.save-row {
  background: var(--water-light);
  border: 1px solid var(--border);
  border-radius: 9px; padding: 14px;
  margin-top: 10px;
}

/* ── Hero-Banner in Login ────────────────────────────────────────────── */
.wave-divider {
  height: 3px;
  background: linear-gradient(90deg,
    transparent,
    var(--teal) 20%,
    var(--teal-light) 50%,
    var(--teal) 80%,
    transparent);
  border-radius: 2px;
  margin: 16px 0;
  opacity: .6;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .zones-grid { grid-template-columns: repeat(2, 1fr); }
  .tab-btn { font-size: 12px; padding: 12px 6px; }
  .login-box { padding: 28px 22px; }
  .brand-sub { display: none; }
  .file-actions { flex-direction: column; }

}

/* ── Scrollbar ───────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--water-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }
