
/* ===== Refined Glassmorph Theme ===== */

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

:root{
  /* Farben & Effekte */
  --bg: #0b0f14;
  --fg: #e8ebee;
  --muted: #a9b2bd;
  --accent: #9ec5ff;
  --card: rgba(255,255,255,0.08);
  --card-strong: rgba(255,255,255,0.12);
  --stroke: rgba(255,255,255,0.18);
  --hover: rgba(255,255,255,0.14);
  --ring: 168, 198, 255;         /* für Focus-Ring (RGB) */
  --ring-alpha: 0.24;

  /* Radius/Blur/Schatten */
  --radius: 14px;
  --blur: 14px;
  --shadow-xs: 0 2px 8px rgba(0,0,0,0.25);
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.45);
  
  /* Typo */
  --h1: clamp(26px, 2.2vw, 34px);
  --h2: clamp(22px, 1.8vw, 28px);
  --h3: clamp(18px, 1.6vw, 22px);
}

* { box-sizing: border-box; }
:root { color-scheme: dark; }

body{
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--fg);
  background:
    radial-gradient(1200px 800px at 10% 0%, rgba(255,255,255,0.04), transparent 60%),
    radial-gradient(1000px 700px at 90% 10%, rgba(255,255,255,0.03), transparent 60%),
    var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* -------- Typografie -------- */
h1, h2, h3, h4, h5, h6{
  color: var(--fg);
  letter-spacing: .2px;
  margin: 0 0 .5em;
}
h1 { font-size: var(--h1); font-weight: 600; }
h2 { font-size: var(--h2); font-weight: 600; }
h3 { font-size: var(--h3); font-weight: 600; }

/* Links */
a{
  color: var(--accent) !important;
  text-decoration: none;
  transition: color .2s ease, opacity .2s ease, text-decoration-color .2s ease;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
}
a:hover{ opacity:.9; text-decoration: underline; }

/* -------- Navigation -------- */
.navbar-brand{
  padding: 10px 15px;
  color: var(--fg);
  font-weight: 600;
  letter-spacing: .3px;
  font-size: 20px;
}

.navbar-nav > li > a{
  color: var(--fg) !important;
  transition: background .25s ease, color .25s ease;
  border-radius: 10px;
  padding-inline: 12px;
  outline: none;       /* keine Browser-Outline */
  box-shadow: none;    /* Basis: kein Schatten */
}

/* Hover: dezent glasig */
.navbar-nav > li > a:hover{
  background: var(--hover);
  color: var(--fg) !important;
  backdrop-filter: blur(calc(var(--blur) - 4px));
  -webkit-backdrop-filter: blur(calc(var(--blur) - 4px));
  box-shadow: var(--shadow-xs);
}

/* Active/Opened: nur Background + Border, KEIN zusätzlicher Schatten */
.navbar-nav > li > a:active,
.navbar-nav > li > a:focus,
.navbar-nav > .open > a,
.navbar-nav > .open > a:focus,
.navbar-nav > .open > a:hover,
.navbar-nav > .active > a,
.navbar-nav > .active > a:focus,
.navbar-nav > .active > a:hover{
  background: rgba(255,255,255,0.12) !important;
  color: var(--fg) !important;
  border: 1px solid var(--stroke);
  box-shadow: none !important;   /* verhindert den „zweiten Rahmen“ */
  outline: none !important;
}

/* Focus-Ring NUR bei nicht-aktivem Item (keine Doppel-Optik) */
.navbar-nav > li > a:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--ring), var(--ring-alpha));
}
.navbar-nav > .active > a:focus-visible{
  box-shadow: none;              /* kein zusätzlicher Ring, wenn aktiv */
}

/* Mobile: kein blaues Tap-Highlight */
a, .navbar-nav > li > a { -webkit-tap-highlight-color: transparent; }

/* -------- Dropdown -------- */
.dropdown-menu{
  background: var(--card) !important;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  animation: fadeIn .18s ease;
  overflow: hidden;
}
.dropdown-menu > li > a{ color: var(--fg); padding: 10px 14px; }
.dropdown-menu > li > a:hover{
  background: var(--hover);
  color: var(--fg);
}

/* -------- Karten / Boxen / Panels -------- */
.panel, .box, .card, .boxContainer, .contentBox, .containerBox, .module, .dashboard-box{
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.06)) !important;
  color: var(--fg) !important;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  overflow: hidden;
}
/* feine Highlight-Kante oben */
.panel::before, .box::before, .card::before, .boxContainer::before, .contentBox::before,
.containerBox::before, .module::before, .dashboard-box::before{
  content:'';
  position:absolute; inset:0; pointer-events:none; border-radius:inherit;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255,255,255,0.35), transparent 42%),
    radial-gradient(120% 60% at 50% 110%, rgba(255,255,255,0.12), transparent 55%);
  mix-blend-mode: soft-light;
}
.panel:hover, .box:hover, .card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255,255,255,0.22);
}

/* Inhalte in Boxen */
.contentBox > div,
.contentBox .boxContent,
.contentBox .innerContent,
.boxBody,
.section,
.dashboard-box .content,
.containerBox > .content,
.module > .content,
.content,
.inner-box,
.block,
.block-body{
  background: var(--card-strong) !important;
  color: var(--fg) !important;
  border: 1px solid var(--stroke);
  border-radius: calc(var(--radius) - 4px);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}

/* -------- Selektionen -------- */
.selected,
.active,
.is-selected,
.selectedRow,
.selected-row,
.highlight,
.highlighted,
.active-box,
tr.selected,
tr.active,
li.selected,
div.selected,
.row.selected,
.selected > *,
.active > *,
tr.selected td,
tr.active td{
  background: rgba(158,197,255,0.14) !important;
  color: var(--fg) !important;
  border: 0px solid rgba(158,197,255,0.35) !important;
  box-shadow: 0 10px 28px rgba(158,197,255,0.14);
}

/* -------- Listen -------- */
.list-group-item{
  background: var(--card) !important;
  color: var(--fg) !important;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  margin-bottom: 6px;
  transition: background .2s, box-shadow .2s, border-color .2s, transform .2s;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}
.list-group-item:hover{
  background: var(--hover) !important;
  border-color: rgba(255,255,255,0.22);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* Header in Boxen */
.box-header, .box-content{ background: transparent !important; }

/* === Box-Titel & Captions (klare, glasige Lesbarkeit) === */
.box-title,
caption {
  color: #f5f8fc; /* hell, aber nicht grellweiß */
  font-weight: 700;
  letter-spacing: .3px;
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.4;
  margin: 0;
  text-transform: none;
  position: relative;

  /* zarter Glas-Gradient im Text */
  background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(200,220,255,0.65));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  /* weiche Tiefe und Lichtkante */
  text-shadow:
    0 1px 2px rgba(0,0,0,0.4),
    0 0 10px rgba(255,255,255,0.05);
}

/* Hover-Effekt (leichtes Aufleuchten, subtil) */
.box-header:hover .box-title,
caption:hover {
  text-shadow:
    0 2px 4px rgba(0,0,0,0.5),
    0 0 14px rgba(158,197,255,0.25);
}

/* Aktiver Zustand – nutzt automatisch deinen Akzentton */
.box-header.active .box-title,
caption.active {
  background: linear-gradient(to bottom, var(--accent), rgba(158,197,255,0.75));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 1px 3px rgba(0,0,0,0.4),
    0 0 16px rgba(158,197,255,0.35);
}

/* Tabellen-Caption (zentriert & typografisch angepasst) */
caption {
  caption-side: top;
  text-align: left;
  padding: 8px 14px;
  font-size: 16px;
  opacity: 0.95;
}

/* -------- Buttons -------- */
.btn{
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--fg);
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow-xs);
}
.btn:hover{
  background: var(--hover);
  transform: translateY(-1px);
}
.btn:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 3px rgba(var(--ring), var(--ring-alpha)),
    0 8px 22px rgba(0,0,0,0.35);
  border-color: rgba(var(--ring), .5);
}

/* Varianten */
.btn-default{
  background: var(--card);
  color: var(--fg);
}
.btn-default:hover{ background: var(--hover); }

.btn-primary{
  background: linear-gradient(180deg, rgba(158,197,255,0.30), rgba(158,197,255,0.18));
  border-color: rgba(158,197,255,0.45);
  color: #0e1116;
}
.btn-primary:hover{
  background: linear-gradient(180deg, rgba(158,197,255,0.38), rgba(158,197,255,0.24));
}

/* -------- Modal -------- */
.modal-content{
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.06));
  color: var(--fg);
  box-shadow: 0 28px 70px rgba(0,0,0,0.55);
  border-radius: 16px;
  border: 1px solid var(--stroke);
  backdrop-filter: blur(calc(var(--blur) + 4px));
  -webkit-backdrop-filter: blur(calc(var(--blur) + 4px));
  animation: fadeIn .22s ease;
}

/* -------- Formulare -------- */
.form-control{
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--stroke);
  color: var(--fg);
  border-radius: 10px;
  transition: border .2s, box-shadow .2s, background .2s;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}
.form-control::placeholder{ color: rgba(232,235,238,0.6); }
.form-control:focus{
  border-color: rgba(158,197,255,0.55);
  box-shadow: 0 0 0 3px rgba(158,197,255,0.22);
  outline: none;
  background: rgba(255,255,255,0.11);
}

/* Input-Gruppen (schöner Anschluss) */
.input-group .form-control{ border-radius: 10px 0 0 10px; }
.input-group .btn{ border-radius: 0 10px 10px 0; }

/* -------- Tabellen -------- */
.table{
  background: var(--card);
  color: var(--fg);
  border-collapse: collapse;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}
.table > thead > tr > th{
  background: rgba(158,197,255,0.10);
  color: var(--fg);
  border-bottom: 1px solid var(--stroke);
  font-weight: 600;
  letter-spacing: .2px;
}
.table-hover > tbody > tr:hover{ background: var(--hover); }

/* -------- Labels / Badges -------- */
.label{
  background: rgba(255,255,255,0.10) !important;
  color: var(--fg) !important;
  border-radius: 8px;
  padding: 3px 10px;
  font-weight: 600;
  border: 1px solid var(--stroke);
  backdrop-filter: blur(calc(var(--blur) - 4px));
  -webkit-backdrop-filter: blur(calc(var(--blur) - 4px));
}
.label-danger{
  background: rgba(217,83,79,0.16) !important;
  border-color: rgba(217,83,79,0.35) !important;
}
.label-primary{
  background: rgba(158,197,255,0.22) !important;
  border-color: rgba(158,197,255,0.40) !important;
}

/* -------- Hintergrundbild -------- */
body:before{
  content:'';
  position: fixed; inset: 0; z-index:-1;
  background-image: url("https://i.imgur.com/8c5kb0I.jpeg");
  background-size: cover; background-position: center; background-repeat: no-repeat;
  filter: brightness(0.55) saturate(0.9);
  transform: scale(1.04);
}

/* -------- Utilities -------- */
.text-muted{ color: var(--muted) !important; }
hr{ border-top: 1px solid rgba(255,255,255,0.12); }

pre{
  background: var(--card-strong);
  color: var(--fg);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* Dezentere Scrollbar */
::-webkit-scrollbar{ width: 10px; }
::-webkit-scrollbar-track{ background: rgba(255,255,255,0.04); }
::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.18);
  border-radius: 8px;
  border: 2px solid rgba(0,0,0,0.1);
}
::-webkit-scrollbar-thumb:hover{ background: rgba(255,255,255,0.26); }

/* -------- Grids (schöne Kartenübersichten) -------- */
.card-grid{
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* -------- Focus-Styles (Zugänglichkeit) -------- */
:where(a, button, .btn, .form-control, [tabindex]):focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--ring), var(--ring-alpha));
  border-color: rgba(var(--ring), .55);
}

/* -------- Animations / Motion -------- */
@keyframes fadeIn{ from{opacity:0; transform: translateY(2px);} to{opacity:1; transform: translateY(0);} }
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}

/* -------- Progressive Enhancement -------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))){
  :root{ --card: rgba(255,255,255,0.12); --card-strong: rgba(255,255,255,0.16); }
}

/* -------- Responsive Tweaks -------- */
@media (max-width: 768px){
  :root{ --blur: 10px; --radius: 12px; }
  .navbar-nav > li > a{ padding-inline: 10px; }
  .card-grid{ gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); }
}

/* -------- Optional: Utility-Klassen -------- */
.glass{ 
  background: var(--card) !important; 
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
}
.glass-strong{
  background: var(--card-strong) !important;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(calc(var(--blur) + 2px));
  -webkit-backdrop-filter: blur(calc(var(--blur) + 2px));
  box-shadow: var(--shadow-lg);
}
/* Elevations */
.elev-1{ box-shadow: var(--shadow-xs) !important; }
.elev-2{ box-shadow: var(--shadow) !important; }
.elev-3{ box-shadow: var(--shadow-lg) !important; }
