﻿/* ================================================================
   BASE / RESET
================================================================ */
:root {
  color-scheme: dark;
  font-family: 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: #23272b;
  color: #e0e0e0;
}

/* ================================================================
   NAVBAR  (shared)
================================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #1a1d21;
  border-bottom: 1px solid #2d3139;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  height: 56px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1em;
  color: #e0e0e0;
  text-decoration: none;
}
.navbar-brand img { height: 26px; object-fit: contain; }
.navbar-links { display: flex; gap: 0.1rem; margin-left: auto; }
.navbar-links a {
  color: #8892a0;
  text-decoration: none;
  padding: 0.4em 0.8em;
  border-radius: 6px;
  font-size: 0.88em;
  white-space: nowrap;
}
.navbar-links a:hover { background: #252a33; color: #e0e0e0; }
.navbar-links a.nav-active { color: #38bdf8; background: #1e2736; }

/* ================================================================
   SHARED PAGE / CARD  (profile_upload, konfigurationen, …)
================================================================ */
main.page {
  max-width: 640px;
  margin: 2rem auto 0;
  padding: 0 1.5rem 4rem;
}
main.page header {
  margin-bottom: 1.5rem;
}
main.page header h1 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #e0e0e0;
  margin: 0 0 0.3rem;
}
.card {
  background: #1c2028;
  border: 1px solid #2d3139;
  border-radius: 1rem;
  padding: 1.5rem 1.8rem;
}

/* ================================================================
   SHARED PAGE HEADER
================================================================ */
.page-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #e0e0e0;
  margin: 0 0 0.3rem;
}
.page-sub {
  color: #8892a0;
  font-size: 0.96em;
  margin: 0;
}

/* ================================================================
   INDEX / UPLOAD PAGE
================================================================ */
body.page-index {
  background-image: url('/assets/b3.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}
body.page-index::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.45);
  z-index: 0;
  pointer-events: none;
}
body.page-index .navbar,
body.page-index .upload-wrap { position: relative; z-index: 1; }

.upload-wrap {
  max-width: 620px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.dropzone {
  border: 2px dashed #343a40;
  border-radius: 1.2rem;
  background: #1c2028;
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone.dragover { border-color: #38bdf8; background: #1a2535; }
.drop-icon { font-size: 2.5rem; line-height: 1; display: block; }
.drop-hint { color: #8892a0; font-size: 0.94em; margin: 0.5rem 0 0; }
.drop-hint strong { color: #c8d2dc; }
.pick-btns { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
.pick-btn {
  background: #272d38;
  color: #c8d2dc;
  border: 1px solid #3a4250;
  border-radius: 8px;
  padding: 0.5em 1.1em;
  font-size: 0.88em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.pick-btn:hover { border-color: #38bdf8; color: #38bdf8; }
#fileList-wrap {
  background: #1c2028;
  border: 1px solid #2d3139;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  display: none;
}
.list-label { margin: 0 0 0.45rem; font-size: 0.78em; color: #5a6370; text-transform: uppercase; letter-spacing: 0.06em; }
#fileList { list-style: none; padding: 0; margin: 0; max-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.2rem; }
#fileList li { font-size: 0.87em; color: #b0b8c0; padding: 0.2em 0; border-bottom: 1px solid #232830; }
#fileList li:last-child { border-bottom: none; }
#progress-container { display: none; }
.prog-track { background: #2c313a; border-radius: 99px; height: 6px; overflow: hidden; }
#progress-bar { height: 100%; background: #38bdf8; border-radius: 99px; width: 0; transition: width 0.2s; }
#progress-bar.indeterminate {
  width: 40% !important;
  animation: indeterminate-slide 1.4s ease-in-out infinite;
}
@keyframes indeterminate-slide {
  0%   { margin-left: 0;    width: 40%; }
  50%  { margin-left: 60%;  width: 40%; }
  100% { margin-left: 0;    width: 40%; }
}
#progress-label { font-size: 0.82em; color: #8892a0; text-align: right; margin-top: 0.3em; }
#result { display: none; border-radius: 10px; padding: 1rem 1.2rem; font-size: 0.95em; line-height: 1.6; }
#result.success    { background: #0d2218; border: 1px solid #166534; color: #4ade80; }
#result.error      { background: #220d0d; border: 1px solid #7f1d1d; color: #f87171; }
#result.processing { background: #111827; border: 1px solid #2d4a6a; color: #93c5fd; }
#result a { color: #38bdf8; font-weight: 600; }
#result code { background: rgba(0,0,0,0.3); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.9em; }
#uploadBtn {
  background: #38bdf8;
  color: #0f1419;
  border: none;
  border-radius: 10px;
  padding: 0.85em 1.5em;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
#uploadBtn:hover { background: #0ea5e9; }

/* Clippy Widget */
.clippy-widget {
  position: fixed;
  bottom: 3.5rem;
  left: 1.5rem;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  gap: 0.9rem;
  max-width: 420px;
}
.clippy-bubble {
  background: rgba(20, 24, 32, 0.88);
  border: 1px solid #2d3139;
  border-radius: 14px 14px 14px 0;
  padding: 0.85rem 1.1rem;
  color: #c8d2dc;
  font-size: 0.83em;
  line-height: 1.55;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  max-width: 290px;
}
.clippy-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid #2d3139;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* ================================================================
   DOWNLOADS PAGE
================================================================ */
.dl-wrap {
  max-width: 860px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem 4rem;
}
.dl-table-wrap {
  margin-top: 1.5rem;
  background: #1c2028;
  border: 1px solid #2d3139;
  border-radius: 1rem;
  overflow: hidden;
}
#download-table { width: 100%; border-collapse: collapse; }
#download-table th {
  background: #232830;
  color: #8892a0;
  font-weight: 500;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.85em 1.2em;
  text-align: left;
}
#download-table td {
  padding: 0.85em 1.2em;
  border-top: 1px solid #2d3139;
  color: #c8d2dc;
  font-size: 0.92em;
}
#download-table tbody tr:hover { background: #222830; }
#download-table .download-btn {
  background: #38bdf8;
  color: #0f1419;
  border: none;
  padding: 0.4em 1em;
  border-radius: 6px;
  font-size: 0.88em;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
#download-table .download-btn:hover { background: #0ea5e9; }

/* Passwort-Bar (Downloads) */
.pw-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #1c2028;
  border: 1px solid #2d3139;
  border-radius: 0.9rem;
  padding: 0.85rem 1.2rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.pw-bar label {
  color: #8892a0;
  font-size: 0.78em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.pw-bar input[type="password"] {
  background: #252a33;
  color: #c8d2dc;
  border: 1px solid #2d3139;
  border-radius: 7px;
  padding: 0.4em 0.9em;
  font-size: 0.88em;
  min-width: 200px;
  outline: none;
}
.pw-bar input[type="password"]:focus { border-color: #38bdf8; }
.pw-confirm-btn {
  background: #1e2736;
  color: #38bdf8;
  border: 1px solid #2d4a6a;
  border-radius: 7px;
  padding: 0.4em 1em;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
}
.pw-confirm-btn:hover { background: #253550; }
#pw-status { font-size: 0.85em; margin-left: 0.3rem; }

/* ================================================================
   DATABASE PAGE
================================================================ */
.db-wrap {
  max-width: 1300px;
  margin: 2.5rem auto 0;
  padding: 0 2rem 4rem;
}
.db-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Filter-Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  background: #1c2028;
  border: 1px solid #2d3139;
  border-radius: 0.9rem;
  padding: 0.85rem 1.2rem;
  margin-bottom: 1rem;
}
.filter-bar label {
  color: #8892a0;
  font-size: 0.78em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.filter-bar select,
.filter-bar input[type="text"] {
  background: #252a33;
  color: #c8d2dc;
  border: 1px solid #2d3139;
  border-radius: 7px;
  padding: 0.4em 0.9em;
  font-size: 0.88em;
  min-width: 160px;
  outline: none;
}
.filter-bar select:focus,
.filter-bar input[type="text"]:focus {
  border-color: #38bdf8;
  background: #252a33;
  color: #c8d2dc;
}
.filter-bar .clear-btn {
  background: #252a33;
  color: #8892a0;
  border: 1px solid #2d3139;
  border-radius: 7px;
  padding: 0.38em 0.7em;
  font-size: 0.85em;
  cursor: pointer;
  line-height: 1;
}
.filter-bar .clear-btn:hover { color: #e0e0e0; }
.filter-sep { width: 1px; height: 1.5em; background: #2d3139; margin: 0 0.2rem; flex-shrink: 0; }

/* Toolbar */
.db-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  gap: 1rem;
}
.pagination { display: flex; align-items: center; gap: 0.5rem; }
.page-btn {
  background: #1c2028;
  color: #8892a0;
  border: 1px solid #2d3139;
  border-radius: 7px;
  padding: 0.38em 1em;
  font-size: 0.88em;
  cursor: pointer;
}
.page-btn:hover { background: #252a33; color: #e0e0e0; }
#page-info { color: #8892a0; font-size: 0.85em; min-width: 5em; text-align: center; }
.reset-btn {
  background: transparent;
  color: #ef4444;
  border: 1px solid #3a1a1a;
  border-radius: 7px;
  padding: 0.38em 1em;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
}
.reset-btn:hover { background: #3a1a1a; }

/* Tabelle */
.table-wrap {
  background: #1c2028;
  border: 1px solid #2d3139;
  border-radius: 1rem;
  overflow: hidden;
  overflow-x: auto;
}
#db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
}
#db-table thead th {
  background: #232830;
  color: #8892a0;
  font-weight: 600;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.85em 1.1em;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid #2d3139;
  user-select: none;
}
.sort-btn {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 0.85em;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.45;
  vertical-align: middle;
}
.sort-btn:hover { opacity: 1; }
#db-table tbody td {
  padding: 0.75em 1.1em;
  border-top: 1px solid #22262e;
  color: #c8d2dc;
  white-space: nowrap;
}
#db-table tbody tr:hover { background: #222830; }
.badge {
  display: inline-block;
  background: #1e2736;
  color: #38bdf8;
  border-radius: 5px;
  padding: 0.15em 0.6em;
  font-size: 0.8em;
  font-weight: 600;
}
