/* RWTH LibreBooking Theme
   Version: 1.2 black-clean
   Primary RWTH blue: #00549F
   Secondary UI color: black / neutral grey
   Install after Bootstrap / LibreBooking CSS.
*/

:root {
  --rwth-blue: #00549F;
  --rwth-blue-dark: #003560;
  --rwth-blue-light: #8EBAE5;
  --rwth-blue-pale: #E8F1FA;

  --rwth-black: #111111;
  --rwth-grey-900: #1F2328;
  --rwth-grey-800: #2F3337;
  --rwth-grey-700: #4A4F54;
  --rwth-grey-600: #646567;
  --rwth-grey-500: #8A8F94;
  --rwth-grey-300: #D9DEE3;
  --rwth-grey-200: #E8EAED;
  --rwth-grey-100: #F5F6F7;
  --rwth-grey-050: #FAFAFA;

  --rwth-border: var(--rwth-grey-300);
  --rwth-shadow: 0 0.35rem 1.2rem rgba(0, 0, 0, 0.08);
}

body {
  background: var(--rwth-grey-050);
  color: var(--rwth-black);
}

/* Links */
a,
.page-link {
  color: var(--rwth-blue);
}

a:hover,
.page-link:hover {
  color: var(--rwth-blue-dark);
}

/* Header / Navigation */
.navbar,
.navbar-dark,
.bg-primary {
  background-color: var(--rwth-blue) !important;
}

.navbar a,
.navbar .nav-link,
.navbar-brand {
  color: #fff !important;
}

.navbar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff !important;
}

/* Dropdown menus: white background, black text */
.dropdown-menu,
.navbar .dropdown-menu,
.dropdown-menu.show {
  background-color: #fff !important;
  color: var(--rwth-black) !important;
  border: 1px solid var(--rwth-border) !important;
  box-shadow: var(--rwth-shadow);
}

.dropdown-item,
.navbar .dropdown-item,
.dropdown-menu a,
.navbar .dropdown-menu a {
  background-color: #fff !important;
  color: var(--rwth-black) !important;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active,
.dropdown-item:active,
.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus,
.navbar .dropdown-item.active,
.navbar .dropdown-item:active,
.dropdown-menu a:hover,
.dropdown-menu a:focus {
  background-color: var(--rwth-grey-200) !important;
  color: var(--rwth-black) !important;
}

/* Language/current menu selection: no teal */
.dropdown-menu .active,
.dropdown-menu .selected,
.dropdown-menu li.active > a,
.dropdown-menu li.selected > a {
  background-color: var(--rwth-grey-200) !important;
  color: var(--rwth-black) !important;
}

/* Remove blue-green/teal accents from headings and labels */
h1, h2, h3, h4, h5, h6,
.page-title,
.dashboard h1,
.dashboard h2,
.dashboard h3,
.dashboardContents h1,
.dashboardContents h2,
.dashboardContents h3,
#page-dashboard h1,
#page-dashboard h2,
#page-dashboard h3,
.resourceName,
.section-title,
.panel-title,
.card-title,
.accordion-button,
.accordion-header,
.resource-availability-title {
  color: var(--rwth-black) !important;
}

/* Section bars neutral */
.card-header,
.modal-header,
.popover-header,
.panel-heading,
.dashboardHeader,
.reservationHeader,
.resourceHeader,
.admin-panel-heading {
  background-color: var(--rwth-grey-100) !important;
  color: var(--rwth-black) !important;
  font-weight: 700;
  border-bottom: 1px solid var(--rwth-border) !important;
}

/* Buttons */
.btn-primary,
.btn-success {
  background-color: var(--rwth-blue) !important;
  border-color: var(--rwth-blue-dark) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
  background-color: var(--rwth-blue-dark) !important;
  border-color: var(--rwth-blue-dark) !important;
  color: #fff !important;
}

.btn-outline-primary {
  color: var(--rwth-blue) !important;
  border-color: var(--rwth-blue) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--rwth-blue) !important;
  color: #fff !important;
}

/* Resource availability buttons: black/dark grey instead of teal */
.resourceName,
.resourceNameSelector,
.resourceNameSelector a,
.resourceNameTitle,
.resourceButton,
.resourceColor,
.resourceItem,
.resource-item,
.availabilityResource,
.resource-availability-resource,
.resource-availability-item,
#resourceDetailsPopup .resourceNameTitle {
  background-color: var(--rwth-grey-800) !important;
  border-color: var(--rwth-black) !important;
  color: #fff !important;
}

.resourceName:hover,
.resourceNameSelector:hover,
.resourceButton:hover,
.resourceItem:hover,
.resource-item:hover,
.availabilityResource:hover,
.resource-availability-resource:hover,
.resource-availability-item:hover {
  background-color: var(--rwth-black) !important;
  color: #fff !important;
}

/* Badges */
.badge.bg-primary,
.label-primary,
.count,
.badge-count {
  background-color: var(--rwth-blue) !important;
  color: #fff !important;
}

/* Remove teal/green badge variants */
.badge.bg-info,
.badge.bg-success,
.label-info,
.label-success,
.bg-info,
.bg-success {
  background-color: var(--rwth-grey-700) !important;
  color: #fff !important;
}

/* Cards / dialogs */
.card,
.modal-content,
.popover,
.panel {
  border: 1px solid var(--rwth-border);
  border-radius: 0.65rem;
  box-shadow: var(--rwth-shadow);
}

/* Tables */
.table thead th,
.table-light th {
  background-color: var(--rwth-grey-100) !important;
  color: var(--rwth-black) !important;
  border-bottom: 2px solid var(--rwth-border);
}

.table-hover tbody tr:hover {
  background-color: var(--rwth-grey-100) !important;
}

/* Forms */
.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--rwth-blue-light) !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 84, 159, 0.22) !important;
}

.alert-info {
  background-color: var(--rwth-grey-100) !important;
  border-color: var(--rwth-grey-300) !important;
  color: var(--rwth-black) !important;
}

/* Calendar / reservation appearance */
.reserved,
.reservation,
.fc-event,
.fc-event-main,
.reservationSlot {
  border-color: var(--rwth-blue-dark) !important;
}

.fc .fc-button-primary {
  background-color: var(--rwth-blue) !important;
  border-color: var(--rwth-blue-dark) !important;
}

.fc .fc-button-primary:hover,
.fc .fc-button-primary:focus {
  background-color: var(--rwth-blue-dark) !important;
}

.fc .fc-day-today,
.today {
  background-color: var(--rwth-grey-100) !important;
}

/* Dashboard */
.dashboardContents .card-header,
.dashboardContents h2,
.dashboardContents h3,
.dashboardContents .resource-availability-title,
#dashboard h2,
#dashboard h3 {
  color: var(--rwth-black) !important;
}

/* Resource popup */
#resourceDetailsPopup .card {
  overflow: hidden;
}

#resourceDetailsPopup .resourceNameTitle,
#resourceDetailsPopup .resourceNameTitle.card-header {
  background-color: var(--rwth-grey-800) !important;
  color: #fff !important;
}

#resourceDetailsPopup .resourceNameTitle h5 {
  color: #fff !important;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0;
}

#resourceDetailsPopup .resourceImage {
  min-width: 260px;
}

#resourceDetailsPopup .resourceImage img {
  max-height: 460px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--rwth-border);
  padding: 0.25rem;
}

#resourceDetailsPopup .attributes,
#resourceDetailsPopup .settings,
#resourceDetailsPopup .description {
  color: var(--rwth-black);
  line-height: 1.45;
}

#resourceDetailsPopup .descriptionContent,
#resourceDetailsPopup .noteContent {
  background: #fff;
  border-left: 4px solid var(--rwth-grey-300);
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem !important;
}

/* Generic admin polish */
.admin-panel,
.dashboardContents,
.reservationContents {
  border-radius: 0.65rem;
}

/* Keep destructive actions visually distinct */
.btn-danger {
  border-color: #a94442 !important;
}

/* Extra cleanup for teal/blue-green text */
.text-info,
.text-success,
.text-teal,
.text-primary-emphasis,
.resource-status,
.resource-type,
.resource-location,
.resource-contact,
.dashboard-title,
.dashboard-section-title {
  color: var(--rwth-black) !important;
}

/* Extra cleanup for teal backgrounds */
.bg-info-subtle,
.bg-success-subtle,
.alert-success,
.alert-primary {
  background-color: var(--rwth-grey-100) !important;
  color: var(--rwth-black) !important;
  border-color: var(--rwth-grey-300) !important;
}

/* Accordion arrows / section icons */
.accordion-button,
.accordion-button:not(.collapsed) {
  background-color: var(--rwth-grey-100) !important;
  color: var(--rwth-black) !important;
  box-shadow: none !important;
}

/* Footer */
footer,
.footer {
  color: var(--rwth-grey-700);
}

@media (max-width: 768px) {
  #resourceDetailsPopup .resourceImage {
    min-width: 100%;
    margin-bottom: 1rem;
  }

  #resourceDetailsPopup .resourceImage img {
    max-height: 320px;
  }
}

/* =========================================================
   CWE/RWTH colour corrections
   Primary: RWTH blue
   Accent:  RWTH Bordeaux
   ========================================================= */

:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
  /* Alle primären Blautöne vereinheitlichen */
  --rwth-blue: #00549f;
  --bs-primary: #00549f;
  --bs-primary-rgb: 0, 84, 159;
  --bs-primary-text-emphasis: #003560;
  --bs-primary-bg-subtle: #e8f1fa;
  --bs-primary-border-subtle: #8ebae5;

  /* Bisherige Cyan-/Info-Akzente werden Bordeaux */
  --rwth-blue-light: #a11035;
  --rwth-accent: #a11035;
  --bs-info: #a11035;
  --bs-info-rgb: 161, 16, 53;
  --bs-info-text-emphasis: #750c27;
  --bs-info-bg-subtle: #f5e8e5;
  --bs-info-border-subtle: #cd8987;

  --bs-link-color: #a11035;
  --bs-link-color-rgb: 161, 16, 53;
  --bs-link-hover-color: #750c27;
  --bs-link-hover-color-rgb: 117, 12, 39;
}

/* Bootstrap-Elemente sicher auf RWTH-Blau setzen */
.btn-primary,
.bg-primary,
.nav-pills .nav-link.active,
.page-item.active .page-link {
  --bs-btn-bg: #00549f;
  --bs-btn-border-color: #00549f;
  --bs-btn-hover-bg: #003f78;
  --bs-btn-hover-border-color: #003f78;
  --bs-btn-active-bg: #003560;
  --bs-btn-active-border-color: #003560;
  background-color: #00549f !important;
  border-color: #00549f !important;
}

/* Terminplan-Akzente: Bordeaux statt Cyan */
.schedule-style,
.schedule-style i,
.schedule-style img,
#calendarToggle,
.schedule-navigation a,
.schedule-dates a,
.resource-filter-toggle,
#resourceFilterToggle,
.text-info,
.link-info {
  color: #a11035 !important;
}

/* Ressourcennamen ohne farbigen Kasten */
.reservations .resourceName,
.reservations .resourceName a,
.reservations .resource-name,
.reservations .resource-name a,
.reservations td.resourceName > *,
.reservations td.resource-name > * {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  color: inherit !important;
}

/* =========================================================
   Final CWE colour corrections
   ========================================================= */

/* Navigationsleiste: ausschließlich RWTH-Blau */
.navbar,
.navbar-dark,
.navbar.bg-primary,
header .navbar,
#header .navbar {
  background: #00549f !important;
  background-color: #00549f !important;
  border-color: #00549f !important;
}

/* Bordeaux für Bedienelemente des Terminplans */
.toggle-sidebar,
.toggle-sidebar:link,
.toggle-sidebar:visited,
.toggle-sidebar i,
#restore-sidebar,
.schedule-navigation a,
.schedule-navigation i,
.schedule-dates a,
.schedule-dates i,
#calendarToggle,
#calendarToggle i {
  color: #a11035 !important;
}

/* Aktive Terminplanansicht: Bordeaux-Markierung */
.schedule-style.active,
.schedule-style.active img,
.schedule-style:hover,
.schedule-style:focus {
  color: #a11035 !important;
  border-color: #a11035 !important;
  border-bottom-color: #a11035 !important;
}

/*
 * Die Ansichts-, Druck- und Favoritensymbole sind teilweise Bilddateien.
 * Dieser Filter färbt deren bisherige blaugrüne Pixel in Bordeaux um.
 */
.schedule_icon,
.schedule-actions img,
.schedule-actions svg {
  filter:
    brightness(0)
    saturate(100%)
    invert(13%)
    sepia(83%)
    saturate(4165%)
    hue-rotate(337deg)
    brightness(82%)
    contrast(101%) !important;
}

/* Ressourcenzelle selbst neutral halten */
table.reservations.condensed td.resourcename {
  background: transparent !important;
  background-color: transparent !important;
  color: #1f2328 !important;
}

/* Dunklen Kasten direkt hinter dem Ressourcennamen entfernen */
table.reservations.condensed td.resourcename > .resourceNameSelector,
table.reservations.condensed td.resourcename > a.resourceNameSelector,
table.reservations.condensed td.resourcename > span.resourceNameSelector {
  display: inline !important;
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #1f2328 !important;
  padding: 0 !important;
}

/* Auch beim Darüberfahren keinen dunklen Kasten erzeugen */
table.reservations.condensed td.resourcename > .resourceNameSelector:hover,
table.reservations.condensed td.resourcename > .resourceNameSelector:focus {
  background: transparent !important;
  background-color: transparent !important;
  color: #a11035 !important;
  text-decoration: underline;
}

/* Ressourcenfilter ausdrücklich Bordeaux */
a.toggle-sidebar.link-primary {
  color: #a11035 !important;
}

/* LibreBooking-Schriftzug im Kopfbereich */
body > .d-flex.align-items-center.gap-2.m-2
  > .border-start
  a.link-primary {
  color: #a11035 !important;
}

body > .d-flex.align-items-center.gap-2.m-2
  > .border-start
  a.link-primary:hover {
  color: #750c27 !important;
}

/* Tagesüberschriften im Terminplan: exaktes RWTH-Blau */
table.reservations.condensed thead td.resdate,
table.reservations.condensed thead td.resdate-custom,
table.reservations.condensed thead td.today {
  background: #00549f !important;
  background-color: #00549f !important;
  border-color: #8ebae5 !important;
  color: #ffffff !important;
}

/* Erklärung direkt oberhalb der Terminplantabelle */
#reservations::before {
  display: block;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  color: #1f2328;
  background-color: #f5e8e5;
  border-left: 4px solid #a11035;
  border-radius: 0.25rem;
  line-height: 1.4;
  white-space: normal;
}

/* Deutsche Sprachversion */
html[lang^="de"] #reservations::before {
  content: "So funktioniert die Buchung: Die Ansicht des Arbeitsplatzes wird angezeigt, wenn Sie mit der Maus über die Raumbezeichnung fahren. Klicken Sie bei der gewünschten Ressource und dem gewünschten Starttag auf „Reservierung anlegen“. Anfang und Ende – auch über mehrere Tage – legen Sie anschließend im Buchungsformular fest.";
}

/* Englisch und Rückfall für alle weiteren Sprachen */
html:not([lang^="de"]) #reservations::before {
  content: "How to make a reservation: The workstation view is displayed when you hover over the room name. Click “Create Reservation” for the desired resource and start date. You can then specify the start and end time – including reservations spanning multiple days – in the reservation form.";
}

/* Aktueller Tageskopf: Bordeaux */
table.reservations.condensed thead td.resdate.today,
table.reservations.condensed thead td.resdate-custom.today {
  background: #a11035 !important;
  background-color: #a11035 !important;
  border-color: #a11035 !important;
  color: #ffffff !important;
}

/* Alten JavaScript-Hinweis ausblenden; CSS-Version bleibt sichtbar */
#schedule-help-text {
  display: none !important;
}
