/* RWTH LibreBooking Theme
   Version: 1.1 grey-clean
   Primary RWTH blue: #00549F
   Secondary UI color: neutral grey instead of blue-green/teal
   Install after Bootstrap / LibreBooking CSS.
*/

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

  --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-grey-900);
}

/* 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,
.navbar .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

/* Remove old 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 {
  color: var(--rwth-grey-800) !important;
}

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

/* Exception: real navigation remains RWTH blue */
.navbar .card-header,
.navbar,
.navbar-dark,
.bg-primary {
  background-color: var(--rwth-blue) !important;
  color: #fff !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;
}

.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: neutral grey instead of teal */
.resourceName,
.resourceNameSelector,
.resourceNameSelector a,
.resourceNameTitle,
.resourceButton,
.resourceColor,
.resourceItem,
.resource-item,
.availabilityResource,
#resourceDetailsPopup .resourceNameTitle {
  background-color: var(--rwth-grey-700) !important;
  border-color: var(--rwth-grey-800) !important;
  color: #fff !important;
}

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

/* Badges */
.badge.bg-primary,
.label-primary,
.count,
.badge-count {
  background-color: var(--rwth-blue) !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-grey-800) !important;
  border-bottom: 2px solid var(--rwth-border);
}

.table-hover tbody tr:hover {
  background-color: var(--rwth-blue-pale);
}

/* 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-blue-pale);
  border-color: var(--rwth-blue-light);
  color: var(--rwth-blue-dark);
}

/* 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-blue-pale) !important;
}

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

/* Resource popup: larger image and more readable content */
#resourceDetailsPopup .card {
  overflow: hidden;
}

#resourceDetailsPopup .resourceNameTitle,
#resourceDetailsPopup .resourceNameTitle.card-header {
  background-color: var(--rwth-grey-700) !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-grey-800);
  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;
}

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

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