/* =============== ADD THIS TO YOUR style.css FILE =============== */

/* --- New Top Header Bar Styles --- */
.top-header {
  background-color: #f8f9fa; /* A light grey background */
  padding: 0.5rem 0;
  border-bottom: 1px solid #dee2e6;
  font-size: 0.8rem;
  color: #495057;
}

.header-title {
  font-weight: 500;
  font-size: 1.5rem;
}

.header-logo-eu img {
  height: 32px; /* Adjust height as needed */
}

/* --- Main Navbar Adjustments --- */
.site-header {
  /* The main header container no longer needs a background color, as its children handle it */
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar {
  /* The main navigation bar now has a white background */
  background-color: #fff;
}

/* Fix for long dropdown menus causing page flicker */
.navbar .dropdown-menu {
  max-height: 75vh; /* Set max height to 75% of the viewport height */
  overflow-y: auto; /* Add a scrollbar inside the menu if it overflows */
}

/* Ensure navbar toggler icon is visible on white background */
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.55)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

thead th {
  text-align: center; /* Horizontal centering */
  vertical-align: middle; /* Vertical centering */
}
/* --- Table Sorting Styles --- */
th.sortable {
  cursor: pointer;
  position: relative;
  padding-right: 20px; /* Make space for the arrow */
}

th.sortable::after {
  content: "\2195"; /* Up-down arrow */
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.3;
}

th.sortable.sorted-asc::after {
  content: "\2191"; /* Up arrow */
  opacity: 1;
}

th.sortable.sorted-desc::after {
  content: "\2193"; /* Down arrow */
  opacity: 1;
}

/* --- Styles for Checkbox Button Filters --- */
.btn-group-toggle .form-check-input {
  /* Hide the actual checkbox but keep it functional */
  position: absolute;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

/* =============== UPDATED Styles for Interactive Obligation Rows =============== */

.obligation-row {
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

.obligation-row:hover {
  --bs-table-hover-bg: #e7edf7; /* Your custom color */
}

/* Style for the container row of the details */
.obligation-details-row td {
  padding: 0.75rem !important; /* Reduce padding around the card */
  background-color: #f1f3f5;
  box-shadow: inset 0 4px 8px -4px rgba(0, 0, 0, 0.1);
}

/* The card itself inside the detail row */
.obligation-details-card {
  border: 1px solid #dee2e6;
}

.obligation-details-card .card-body {
  padding: 1rem; /* Reduce padding inside the main card body */
}

/* Make list items in the details card more compact */
.obligation-details-card .list-group-item {
  background-color: transparent;
  border: none;
  padding: 0.25rem 0; /* Squeeze vertical padding */
}

.obligation-details-card .card-subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  color: #6c757d !important;
}

/* Reduce margin on paragraphs inside cards */
.obligation-details-card .card-text {
  margin-bottom: 0.5rem;
}

.table-active {
  --bs-table-active-bg: #f2f3f5; /* Your custom color */
}
/* --- NEW: Styles for Fixed Table Layout --- */
.table-fixed-layout {
  table-layout: fixed;
  width: 100%;
}

.table-fixed-layout td {
  /* Allow content to wrap naturally within the fixed-width cells */
  white-space: normal;
  word-wrap: break-word; /* For long words that could break layout */
}

.btn-group-toggle .btn-outline-primary:not(.active):hover {
  background-color: #e7f1ff; /* A pleasant light blue background */
  color: #0d6efd; /* Keeps the original blue text color */
}

/* --- Heading Font Size Reduction (20% smaller) --- */
/* Target both element selectors and Bootstrap utility classes */
h1, .h1 { font-size: 2.0rem !important; } /* 3.0rem * 0.8 = 2.4rem */
h2, .h2 { font-size: 1.9rem !important; } /* 2.4rem * 0.8 = 1.92rem */
h3, .h3 { font-size: 1.5rem !important; } /* 1.92rem * 0.8 = 1.536rem */
h4, .h4 { font-size: 1.2rem !important; } /* 1.536rem * 0.8 = 1.2288rem */
h5, .h5 { font-size: 1.0 !important; } /* 1.2288rem * 0.8 = 0.98304rem */
h6, .h6 { font-size: 0.8 !important; } /* 0.98304rem * 0.8 = 0.786432rem */

/* --- EIONET Groups Page Layout Fixes --- */
/* Fix overlapping collapsible content in group cards */
.group-card .card-footer {
  position: relative;
  padding-bottom: 1rem !important;
}

.group-card .collapse {
  position: relative;
  z-index: 10;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.group-card .collapse .card {
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 0.5rem;
}

.group-card .collapse .card-body {
  max-height: 200px;
  overflow-y: auto;
  padding: 0.75rem;
}

.group-card .collapse .card-body .border-bottom:last-child {
  border-bottom: none !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Ensure proper spacing between buttons and collapsible content */
.group-card .card-footer > div {
  margin-bottom: 0.5rem;
}

.group-card .card-footer > div:last-child {
  margin-bottom: 0;
}

/* Fix for long lists in collapsible sections */
.group-card .collapse.show {
  margin-bottom: 1rem;
}
