/* =========================================================
   Basis-Variablen für Farben & Shadows (Adminbereich)
   ========================================================= */

:root {
  /* Grundfarben */
  --bt-color-white: #ffffff;
  --bt-color-black: #000000;

  --bt-color-gray-dark: #575757;
  --bt-color-gray-mid: #666666;
  --bt-color-gray-soft: #777777;
  --bt-color-gray-300: #e0e0e0;
  --bt-color-gray-bg: #f3f4f6;

  /* Brand-Gelb + Varianten */
  --bt-color-yellow: #ffcc00;
  --bt-color-yellow-soft: #ffe064;
  --bt-color-yellow-soft2: #fff3c4;
  --bt-color-yellow-border-soft: #ffd966;
  --bt-color-yellow-border-soft2: #ffdd55;
  --bt-color-doc-border: #ffeaaa;
  --bt-color-doc-bg: #fffef9;
  --bt-color-doc-hover-bg: #fff7cc;

  /* Initial-Mail / Attachments */
  --bt-color-initial-bg: #fffef5;
  --bt-color-initial-header-bg: #fff7d6;
  --bt-color-initial-atts-bg: #fffbe8;
  --bt-color-thumb-bg: #f6f6f6;
  --bt-color-thumb-border: #eeeeee;

  /* Modal / Backdrop */
  --bt-color-modal-row-alt: #fdf9ec;
  --bt-overlay-backdrop: rgba(0,0,0,.45);

  /* Authbar / Icons */
  --bt-color-auth-icon: #374151;

  /* Shadows */
  --bt-shadow-card-main: 0 12px 28px rgba(0,0,0,0.22);
  --bt-shadow-card-inset: 0 1px 1px rgba(255,255,255,0.4) inset;
  --bt-shadow-card-hover: 0 16px 40px rgba(0,0,0,0.4);
  --bt-shadow-initial: 0 4px 12px rgba(255,204,0,0.35);

  /* Gelb als RGB für rgba() */
  --bt-yellow-rgb: 255, 204, 0;

  /* Kompatible Aliase zu bestehenden Vars (falls anderswo genutzt) */
  --bt-white: var(--bt-color-white);
  --bt-gray-300: var(--bt-color-gray-300);
  --bt-black: var(--bt-color-gray-dark);
  --bt-alert-modal-bg: var(--bt-color-modal-row-alt);
}

/* =========================================================
   Karten / Tickets
   ========================================================= */

.bt-card {
  background: var(--bt-color-white);
  border-radius: 12px;
  box-shadow:
    var(--bt-shadow-card-main),
    var(--bt-shadow-card-inset);
  border: 1px solid rgba(0,0,0,0.06);
}

/* Hover-Effekt und Clickbarkeit der Tickets */
.bt-card--ticket {
  cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease;
}

.bt-card--ticket:hover,
.bt-card--ticket:focus {
  box-shadow:
    var(--bt-shadow-card-hover),
    0 0 0 4px rgba(var(--bt-yellow-rgb), 0.8); /* Brand-Gelb Glow */
  transform: translateY(-1px);
  outline: none;
}

/* Abstände der ticket_detail Sektionen */
.intital_mail,
.meta_card,
.activity_list {
  margin-bottom: 20px;
}

/* =========================================================
   Logout-Button in der Authbar
   ========================================================= */

/* LogOut Button explizit aus Weiß rausnehmen */
.bt-authbar .logout,
.bt-authbar .logout i {
  color: var(--bt-color-gray-dark) !important;
  text-shadow: none !important;
  filter: none !important;
}

/* leichter Button-Look für Logout */
.bt-authbar .logout {
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: .4rem .6rem;
  line-height: 1.2;
  font-weight: 500;
}

/* Hover-Effekt auf Logout separat definieren */
.bt-authbar .logout:hover {
  background: var(--bt-color-yellow);
  border-color: var(--bt-color-yellow);
  color: var(--bt-color-black) !important;
}
.bt-authbar .logout:hover i {
  color: var(--bt-color-black) !important;
}

/* Admin-Hinweis-Balken */
.bt-admin-alert {
    max-width: 1170px;
    margin: 20px auto;
    padding: 8px 10px;
    background-color: #ffcc00;   
    color: #575757;
    text-align: center;
    border-radius: 5px;          
    font-size: 0.9rem;
    font-weight: 600;
}


/* =========================================================
   Fortschritts-Buttons & Fortschrittsbalken
   ========================================================= */

/* Basis-Style der Fortschritts-Buttons */
.bt-progress-set {
  background: var(--bt-color-gray-dark);
  color: var(--bt-color-white);
  border: 0;
  cursor: pointer;
  transition: transform 0.12s ease;
}

/* Exakter Treffer (z. B. Eingabe 75 → Button 75) */
.bt-progress--exact {
  background: var(--bt-color-yellow) !important;
  color: var(--bt-color-gray-dark) !important;
}

/* Näher dran (primärer Kandidat) */
.bt-progress--near {
  background: var(--bt-color-yellow-soft) !important;
  color: var(--bt-color-gray-dark) !important;
}

/* Zweitnächster Kandidat / Gleichstand */
.bt-progress--second {
  background: var(--bt-color-yellow-soft2) !important;
  color: var(--bt-color-gray-dark) !important;
}

/* kleiner Aufmerksamkeitspuls, wenn Wert sich ändert über Pfeile/Klick */
.bt-progress--bump {
  transform: scale(1.06);
}

/* Wrapper um das Eingabefeld + die Anzeige */
.bt-progress-fieldwrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bt-progressbar-outer {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.2);
  box-shadow: inset 0 0 2px rgba(0,0,0,0.4);
  overflow: hidden;
}

.bt-progressbar-inner {
  position: relative;
  height: 100%;
  border-radius: inherit;
  background: #dffff3; /* wird via JS überschrieben */
  width: 0%;
  transition: width 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 0 6px rgba(0,0,0,0.15);
  overflow: hidden; /* Shine bleibt im gefüllten Bereich */
}

/* Shine-Fleck selbst */
.bt-progressbar-inner::after {
  content: "";
  position: absolute;
  top: 0;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: radial-gradient(
    circle at 20% 50%,
    rgba(var(--bt-yellow-rgb), 1) 0%,
    rgba(var(--bt-yellow-rgb), 0.712) 35%,
    rgba(var(--bt-yellow-rgb), 0.295) 60%,
    rgba(var(--bt-yellow-rgb), 0) 80%
  );
  opacity: 0;
  pointer-events: none;
  filter: blur(2px);
}

/* Shine bei Fortschritt NACH OBEN (Links -> Rechts) */
.bt-progressbar-inner.bt-progressbar-shine-up::after {
  animation: shine-move-forward 0.8s ease-out forwards;
  opacity: 1;
  left: -40%;
}

/* Shine bei Fortschritt NACH UNTEN (Rechts -> Links) */
.bt-progressbar-inner.bt-progressbar-shine-down::after {
  animation: shine-move-back 1.5s ease-out forwards;
  opacity: 1;
  left: 100%;
}

/* Vorwärtslauf (links → rechts) */
@keyframes shine-move-forward {
  0% {
    left: -40%;
    opacity: 0;
  }
  10% {
    left: -20%;
    opacity: 1;
  }
  50% {
    left: 40%;
    opacity: 1;
  }
  100% {
    left: 120%;
    opacity: 0;
  }
}

/* Rückwärtslauf (rechts → links) */
@keyframes shine-move-back {
  0% {
    left: 100%;
    opacity: 0;
  }
  10% {
    left: 80%;
    opacity: 1;
  }
  50% {
    left: 20%;
    opacity: 1;
  }
  100% {
    left: -40%;
    opacity: 0;
  }
}

/* Beispiel-Row-Highlight (externes Var) */
.row-in {
  background-color: var(--prio-high);
}

.bt-dueline__label {
  display: none;
}

.bt-dueline__pointer.has-tooltip {
  margin: 0 !important;
}

/* =========================================================
   Mail-Alerts Liste (kleine Liste)
   ========================================================= */

.bt-alerts-list--mail {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bt-alerts-list--mail li {
  margin: 0;
}

/* Alternierende Hintergründe pro Zeile */
.bt-alerts-list--mail li:nth-child(odd) {
  background-color: var(--bt-white, #ffffff);
}

.bt-alerts-list--mail li:nth-child(even) {
  background-color: var(--bt-gray-300, #e0e0e0);
}

/* Ganze Zeile klickbar, einzeiliges Layout */
.bt-alerts-mail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--bt-black, var(--bt-color-gray-dark));
}

/* Titel & Meta nebeneinander, aber bei wenig Platz umbrechbar */
.bt-alerts-mail-row__main {
  display: flex;
  flex: 1;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Linke Seite (Icon + Betreff) */
.bt-alerts-mail-row__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bt-alerts-mail-row__title span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rechte Seite (Ticketnummer + Datum) */
.bt-alerts-mail-row__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* Hover: gesamte Zeile mit Alert-Modal-HG */
.bt-alerts-list--mail li:hover {
  background-color: var(--bt-alert-modal-bg, var(--bt-color-modal-row-alt));
}

/* Sicherheitshalber: Farbe des Linktexts auch im Hover/Zustand fixen */
.bt-alerts-mail-row:hover,
.bt-alerts-mail-row:focus,
.bt-alerts-mail-row:active {
  color: var(--bt-black, var(--bt-color-gray-dark));
  text-decoration: none;
}

/* =========================================================
   Mail-Alerts Modal (großes Modal)
   ========================================================= */

.bt-mailalerts-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bt-overlay-backdrop);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1050;
}

.bt-mailalerts-backdrop.is-open {
  display: flex;
}

.bt-mailalerts-modal {
  background: var(--bt-color-white);
  border-radius: 10px;
  max-width: 900px;
  width: 96%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  overflow: hidden;
}

/* Header */
.bt-mailalerts-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: #fffbe9;
}

.bt-mailalerts-modal__header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.bt-mailalerts-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: .25rem .35rem;
  border-radius: 6px;
  line-height: 1;
  color: var(--bt-color-gray-dark);
}

.bt-mailalerts-close:hover {
  background: rgba(0,0,0,.06);
}

/* Body */
.bt-mailalerts-modal__body {
  padding: .5rem 0;
  overflow: auto;
}

.bt-mailalerts-empty {
  padding: .75rem 1rem 1rem;
  font-size: .9rem;
  color: var(--bt-color-gray-soft);
}

/* Liste + Zeilen */
.bt-mailalerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bt-mailalerts-list li {
  border-bottom: 1px solid rgba(0,0,0,.04);
}

/* Wechselnde Hintergrundfarben */
.bt-mailalerts-list li:nth-child(odd) {
  background: var(--bt-white, #ffffff);
}

.bt-mailalerts-list li:nth-child(even) {
  background: var(--bt-gray-300, #e0e0e0);
}

/* Gesamte Zeile als Link */
.bt-mailalerts-row-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .6rem .9rem;
  text-decoration: none;
  color: var(--bt-black, var(--bt-color-gray-dark));
  cursor: pointer;
}

/* Zeile Hover */
.bt-mailalerts-list li:hover {
  background: var(--bt-alert-modal-bg, var(--bt-color-modal-row-alt));
}

.bt-mailalerts-row-main {
  flex: 1;
  min-width: 0;
}

.bt-mailalerts-row-title {
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.bt-mailalerts-row-meta {
  font-size: .8rem;
  color: var(--bt-color-gray-mid);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* kleines Icon links, optional */
.bt-mailalerts-row-icon {
  margin-right: .4rem;
  flex: 0 0 auto;
  font-size: 1rem;
}

/* Backdrop über ID (kompatibel zu bestehendem HTML) */
#btMailAlertsModalBackdrop {
  position: fixed;
  inset: 0;
  background: var(--bt-overlay-backdrop);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1050;
}

#btMailAlertsModalBackdrop.is-open {
  display: flex;
}

/* Inneres Modal kann dein vorhandenes .bt-alerts-modal nutzen */
#btMailAlertsModalBackdrop .bt-alerts-modal {
  max-width: 900px;
  width: 96%;
  max-height: 80vh;
  overflow: auto;
}

/* =========================================================
   Buttons & Badges allgemein
   ========================================================= */

.bt-btn--danger {
  background-color: var(--bt-badge-danger);
  color: var(--bt-color-white);
}

/* =========================================================
   Authbar / Navigation (20.11.2025)
   ========================================================= */

/* Basis-Layout der Topbar */
.bt-authbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  padding: .35rem .5rem !important;
  gap: .5rem !important;
}

/* Hauptnavigation (Desktop-Standard) */
.bt-mainnav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

/* Burger-Button (Desktop zunächst versteckt) */
.bt-nav-toggle {
  display: none;
  width: 28px;
  height: 28px;
}

/* Rollen-Icon (Bubble) */
.bt-role-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--bt-color-gray-bg);
  color: var(--bt-color-auth-icon);
}

/* Logout-Button in der Topbar etwas kompakter */
.bt-authbar__right .logout {
  padding: .25rem .35rem;
}

/* Logo: Desktop-Göße (muss inline-Style übersteuern) */
.bt-authlogo img {
  height: 25px !important;
}

/* Einheitliche Typografie in der Topbar */
.bt-authbar .bt-authlink,
.bt-authbar .bt-btn,
.bt-authbar .bt-alerts-btn,
.bt-authbar .bt-sub,
.bt-authbar .bt-badge,
.bt-authbar .bt-role-icon {
  font-size: 0.8rem !important;
}

.bt-authbar .bt-alerts-btn i,
.bt-authbar .bt-role-icon i,
.bt-authbar .bt-authlink i,
.bt-authbar .bt-btn i {
  font-size: 1rem !important;
}

/* Allgemeines Padding für Links/Buttons in der Topbar */
.bt-authbar .bt-authlink,
.bt-authbar .bt-btn,
.bt-authbar .bt-alerts-btn {
  padding: .25rem .4rem !important;
}

/* Trenner in der Topbar dezenter */
.bt-authbar .bt-authsep {
  padding: 0 .15rem;
}

/* Badge im Icon etwas kleiner */
.bt-authbar .bt-badge-count {
  font-size: 12px;
  padding: 0 5px;
  line-height: 15px;
}

/* Buttons in der Topbar NICHT full-width */
.bt-authbar .bt-btn,
.bt-authbar .bt-alerts-btn,
.bt-authbar .logout {
  width: auto !important;
}

/* Desktop vs. Mobile für Userinfo & Logout – Default = Desktop */
.bt-userinfo--desktop,
.bt-logout--desktop {
  display: inline-flex;
}

.bt-userinfo--compact,
.bt-logout--compact {
  display: none;
}

/* ----------------------------------------
   Mobile / schmale Ansicht < 1350px
   ---------------------------------------- */
@media (max-width: 1350px) {
  .bt-authbar__left {
    position: relative;
  }

  /* Burger-Button anzeigen */
  .bt-nav-toggle {
    display: inline-flex !important;
    padding: 0;
  }

  /* Hauptnavigation als Dropdown */
  .bt-mainnav {
    display: none !important;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    padding: .35rem .5rem;
    background: var(--bt-color-white);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,.14);
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
    z-index: 1039;
    width: 150px;
  }

  .bt-authbar.bt-authbar--nav-open .bt-mainnav {
    display: flex !important;
  }

  .bt-mainnav .bt-authlink,
  .bt-mainnav .bt-btn,
  .bt-mainnav .bt-authsep {
    padding-left: 0;
    padding-right: 0;
    margin: 0;
  }

  .bt-mainnav .bt-authsep {
    display: none;
  }

  .bt-mainnav a.bt-authlink,
  .bt-mainnav a.bt-btn {
    /*width: 100%;*/
    text-align: left;
  }

  /* Userinfo & Logout kompakt anzeigen */
  .bt-userinfo--desktop,
  .bt-logout--desktop {
    display: none !important;
  }

  .bt-userinfo--compact,
  .bt-logout--compact {
    display: inline-flex !important;
  }

  .bt-mainnav .fa-solid {
    margin-right: 3px;
  }
}

/* ----------------------------------------
   Mobile / sehr schmale Ansicht < 1000px
   ---------------------------------------- */
@media (max-width: 1000px) {
  .bt-authlogo img {
    height: 20px !important;
  }
}

/* =========================================================
   Initial-Mail (Ticket-Auslöser) - Hervorgehobene Darstellung
   ========================================================= */

.bt-initial-mail {
  border: 2px solid var(--bt-color-yellow);
  border-radius: 10px;
  background: var(--bt-color-initial-bg);
  padding: 0;
  margin-top: 10px;

  /* Schwebend / plastisch */
  box-shadow: var(--bt-shadow-initial);

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header (Betreff / An / CC) */
.bt-init-header {
  background: var(--bt-color-initial-header-bg);
  padding: 12px 16px;
  border-bottom: 1px solid var(--bt-color-yellow);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.bt-init-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #222;
}

.bt-init-meta {
  text-align: right;
  color: #555;
  font-size: 0.78rem;
  line-height: 1.3;
  white-space: nowrap;
}

/* Body (Inhalt der E-Mail) */

/* Wenn Metas NICHT gesetzt → max 550px, scrollbar */
.bt-initial-mail.is-open .bt-init-body {
  max-height: 550px;
  overflow-y: auto;
}

/* Wenn Metas gesetzt → max 200px, scrollbar */
.bt-initial-mail.is-final .bt-init-body {
  max-height: 200px;
  overflow-y: auto;
}

.bt-init-body {
  padding: 16px;
  font-size: 0.9rem;
  color: #222;
  line-height: 1.45;
  word-break: break-word;
}

/* Attachments-Bereich */
.bt-init-atts {
  border-top: 1px solid var(--bt-color-yellow-border-soft);
  padding: 12px 16px;
  background: var(--bt-color-initial-atts-bg);
}

/* Responsive */
@media (max-width: 900px) {
  .bt-init-header {
    flex-direction: column;
    text-align: left;
    gap: 6px;
  }

  .bt-init-meta {
    text-align: left;
    white-space: normal;
  }

  /* Mobile etwas kompakter */
  .bt-initial-mail.is-open .bt-init-body,
  .bt-initial-mail.is-final .bt-init-body {
    max-height: 320px;
  }
}

/* ============================================================
   Attachments in der Initial-Mail – Galerie + Dateien getrennt
   ============================================================ */

.bt-att-section {
  margin-top: 1rem;
  padding-top: 0.5rem;
}

.bt-att-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.9;
}

/* Bild-Galerie */
.bt-att-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Download-Dateien (Listen-Optik + Hover) */
.bt-att-docs .bt-attachment-item {
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--bt-color-doc-bg);
  border: 1px solid var(--bt-color-doc-border);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.bt-att-docs .bt-attachment-item:hover {
  background: var(--bt-color-doc-hover-bg);
  box-shadow: 0 2px 6px rgba(var(--bt-yellow-rgb), 0.25);
}

.bt-att-docs .bt-attachment-item + .bt-attachment-item {
  margin-top: 6px;
}

/* Bild-Thumbnails schöner / moderner */
.bt-att-images .bt-attach-thumb {
  border-radius: 6px;
  overflow: hidden;
  background: var(--bt-color-thumb-bg);
  border: 1px solid var(--bt-color-thumb-border);
  transition: transform .15s ease, box-shadow .15s ease;
}

.bt-att-images .bt-attach-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

/* Trennungslinie zum Mailbody */
.bt-init-atts {
  margin-top: 1rem !important;
  border-top: 2px dashed var(--bt-color-yellow-border-soft2) !important;
  padding-top: 1.2rem;
}

/* Fix: Galerie-Bilder sicher nebeneinander */
.bt-attach-images {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  align-items: flex-start !important;
}

.bt-attach-images .bt-attach-thumb {
  display: flex !important;
  flex-direction: column !important;
  width: 120px !important;
  max-width: 120px !important;
  flex: 0 0 auto !important;
}

/* =========================================================
   Scrollbarer Body der normalen E-Mail-Nachrichten
   ========================================================= */

.bt-msg-body-inner {
  max-height: 250px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.06);
  background: var(--bt-color-white);
}

/* leicht andere Optik, wenn Body leer ist */
.bt-msg-body-inner .bt-sub {
  color: var(--bt-color-gray-soft);
}

.bt-btn.bt-btn--primary{
  padding: .5rem .5rem !important;
}


.bt-title--revision {
  position: relative;
  display: inline-block;
  /* Basis-Farbe, falls kein fancy Support */
  color: #dc2626;
  font-weight: 700;
}

/* nur moderner Kram mit background-clip */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .bt-title--revision {
    background-image: linear-gradient(
      120deg,
      #7f1d1d 0%,
      #b91c1c 20%,
      #fecaca 35%,
      #b91c1c 50%,
      #7f1d1d 70%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent; /* Textfarbe kommt aus dem Verlauf */
    animation: bt-shimmer-text 2.5s linear infinite;
  }
}

@keyframes bt-shimmer-text {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
