.container {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  margin: 20px auto;
  width: 100%;
  gap: 20px;
}

.card {
  flex: 1 1 calc(50% - 10px);
  min-width: 400px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 600px;
}

.card-header {
  padding: 20px 20px 10px 20px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.card-title {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #000000de;
  line-height: 1.3;
}

.card-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #666;
  line-height: 1.4;
  display: flex;
  align-items: center;
}

.card-body {
  flex: 1;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0; /* allow children to use full width in Chromium */
}

/* Specific styles for full-width cards (like newest entries) */
.card-full-width .card-body {
  min-height: 200px;
  /* Ensure minimum height for content */
  flex: none;
  /* Allow natural height based on content */
}

/* Hide empty Plotly divs that may be generated */
.card-body>.dash-graph>div:empty {
  display: none;
}

/* Ensure Dash graph wrapper itself stretches properly in flex layouts */
.card-body > .dash-graph,
.card-chart > .dash-graph {
  flex: 1 1 auto;
  width: 100% !important;
  min-width: 0; /* important for Chrome flexbox sizing */
}

/* Plotly graph sizing inside card body: fill container */
.card-body .js-plotly-plot,
.card-body .plotly,
.card-body .plot-container {
  width: 100% !important;
  height: 100% !important; /* fill available height */
  min-height: 0 !important; /* don't force extra space */
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}

/* Card chart containers: fill available space and avoid clipping */
.card-chart .js-plotly-plot,
.card-chart .plotly,
.card-chart .plot-container,
.card-chart .svg-container {
  width: 100% !important;
  height: 100% !important;
  min-height: 200px !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}

.card-footer {
  padding: 10px 20px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
  flex-shrink: 0;
}

.source-info {
  font-size: 0.85rem;
  color: #888;
  margin: 0;
  text-align: right;
}

@media (max-width: 768px) {
  .container {
    justify-content: center;
    margin: 10px auto;
  }

  .card {
    flex: 1 1 100%;
    min-width: auto;
  }
}

h1,
h2,
h3,
h4 {
  font-family: Roboto, sans-serif;
  font-weight: 300;
  padding-top: 30px;
}

h1 {
  font-size: 2.5rem;
  line-height: 34px;
}

.container>h2,
.container>.section-title {
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.5px;
  text-align: left;
  font-family: Roboto, sans-serif;
  font-weight: 300;
  margin: 0 0 18px 0;
  padding: 0;
  width: 100%;
  align-self: flex-start;
}

h3 {
  font-size: 1.5rem;
  line-height: 1.375;
  letter-spacing: 0.18px;
}

h4 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.18px;
  color: #000000de;
}

a {
  color: #14516f;
}

.info-icon {
  margin-left: 8px;
  cursor: pointer;
  display: inline-flex;
  color: #666;
  font-size: 0.9rem;
}

.tooltip {
  background-color: #f9f9f9;
  color: black;
  border: 2px solid lightgrey;
  border-radius: 5px;
  padding: 10px;
  font-size: 14px;
  width: 300px;
  position: absolute;
  z-index: 1000;
  display: none;
  pointer-events: none;
}

.tooltip.show {
  display: block;
}

.button-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  white-space: nowrap;
  padding: 0;
  background-color: #f5f5f5;
  box-shadow: inset 0 -10px 10px -10px #d5d5d5;
  height: 52px;
}

.button-bar ul {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.button-bar li {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}

.button-bar li a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  font-size: 16px;
  color: #343a40;
  background-color: transparent;
  border: none;
  border-radius: 0;
  user-select: none;
  transition: background-color 0.25s ease-in-out;
  cursor: pointer;
  text-decoration: none;
  border-right: 1px solid #d5d5d5;
  height: 52px;
}

.button-bar li a.active {
  font-weight: bold;
  background-color: white;
  color: #343a40;
  height: 52px;
}

.button-bar li a:hover,
.button-bar li a:focus {
  background-color: #e9ecef;
}

.layout-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.layout-title {
  font-size: 1.65rem;
  font-weight: 300;
  color: #757575;
  padding-left: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-label {
  font-weight: bold;
}

/* Ensure graph containers don't exceed card bounds */
.card-chart {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* let Plotly handle internal centering; keep container edges clean */
  overflow: hidden; /* avoid layout spills while keeping content inside padding */
  min-height: 200px; /* default minimum height */
  position: relative; /* Create positioning context */
  padding-left: 16px; /* keep y-axis labels like 0% fully visible */
  padding-right: 16px; /* avoid clipping on the right */
  box-sizing: border-box;
  min-width: 0; /* ensure percent widths resolve correctly in Chromium */
}

footer {
  background-color: #f8f9fa;
  padding: 1rem;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
  color: #343a40;
  width: 100%;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 1rem;
  color: #343a40;
}

.footer-left {
  font-size: 0.9rem;
  color: #343a40;
}

.footer-right {
  margin-left: auto;
}

.footer-right a {
  text-decoration: none;
  color: #14516f;
  font-size: 0.9rem;
}

.footer-right a:hover {
  text-decoration: underline;
}

.header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 100%;
  background-color: #fff;
  border-bottom: 5px solid #dc0018;
  padding: 0px 0px 0px 0px;
}

.header-title {
  font-family: Roboto, sans-serif;
  font-size: 26.4px;
  color: rgb(117, 117, 117);
  margin-top: 30px;
  padding-left: 20px;
  border-left: 1px solid lightgrey;
}

.header-logo {
  width: 245px;
  padding-left: 15px;
  padding-right: 15px;
  padding-top: 5px;
}

.layout-lang {
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-right: 10px;
}

.language-switcher {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
}

.language-switcher li {
  margin: 0 4px;
}

.language-switcher a {
  color: rgb(23, 23, 23);
  font-size: 16px;
  padding: 9px 9px;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 400;
  border-radius: 0px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.language-switcher a:hover,
.language-switcher a:focus {
  color: rgb(23, 23, 23);
  background-color: #e5e5e5;
  text-decoration: none;
}

.language-switcher a.active {
  color: rgb(23, 23, 23);
  background-color: #e5e5e5;
}

.language-switcher a:not(:last-child) {
  border-right: 1px solid #ddd;
  padding-right: 15px;
}

/* Intro text styles */
.intro-text {
  font-size: 1.25em;
}

.intro-summary {
  font-size: 1.25em;
}

.intro-unit {
  margin-bottom: 30px;
}

/* Dashboard content visibility control */
.dashboard-content {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.dashboard-content.loaded {
  opacity: 1;
}

/* Add scroll margin for anchor links */
h2[id],
h3[id] {
  scroll-margin-top: 70px;
  /* Provides space above the element when scrolled to via anchor link */
}

/* Loading indicator for intro section */
.intro-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 150px;
  width: 100%;
}

.loading-spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: #14516f;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* New entries tile specific styles */
.card-full-width {
  flex: 1 1 100%;
  min-width: 100%;
  height: auto;
  /* Allow height to adapt to content */
  min-height: 200px;
  /* Set a minimum height */
}

/* Specific styles for half-width cards */
.card-half-width {
  flex: 1 1 calc(50% - 10px);
  min-width: 400px;
  max-width: calc(50% - 10px);
}

.new-entries-chart {
  padding: 0;
  min-height: 150px;
  /* Ensure minimum content area */
}

.new-entries-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  padding: 10px;
}

.new-entries-section {
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 12px;
  border-left: 3px solid #14516f;
  height: fit-content;
}

.new-entries-section-title {
  margin: 0 0 10px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #14516f;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 6px;
}

.new-entries-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.entry-item {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e9ecef;
}

.entry-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.entry-link {
  color: #14516f;
  text-decoration: none;
  font-weight: 500;
  line-height: 1.3;
  display: block;
  word-wrap: break-word;
  font-size: 0.9rem;
}

.entry-link:hover {
  text-decoration: underline;
  color: #0d3a52;
}

.entry-meta {
  color: #6c757d;
  font-size: 0.75rem;
  line-height: 1.2;
  margin-top: 2px;
  display: block;
}

.date-info {
  color: #8a8a8a;
}

.no-data-message {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 20px;
  margin: 0;
}

.new-entries-empty {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
}

/* Ranking list styles */
.ranking-list ol {
  margin: 0;
  padding: 0 0 0 25px;
  max-height: 400px;
  overflow-y: auto;
}

.ranking-list li {
  margin-bottom: 10px;
  line-height: 1.4;
  font-size: 0.95rem;
}

.ranking-list a {
  color: #14516f;
  text-decoration: none;
}

.ranking-list a:hover {
  text-decoration: underline;
}

.no-data-list {
  color: #6c757d;
  font-style: italic;
  margin: 20px 0;
  padding: 0 0 0 25px;
}

/* Scrollable list for datasets */
.scrollable-list {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 10px; /* Add some padding for scrollbar */
}

.datasets-container {
  margin: 0;
  padding: 0;
}

.dataset-item {
  margin-bottom: 10px;
  line-height: 1.4;
  font-size: 0.95rem;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.dataset-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.dataset-item a {
  color: #14516f;
  text-decoration: none;
}

.dataset-item a:hover {
  text-decoration: underline;
}

.publisher {
  color: #666;
  font-size: 0.9rem;
}

/* Pagination styles */
.pagination-btn {
  background-color: #14516f;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.pagination-btn:hover {
  background-color: #0d3a52;
}

.pagination-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.page-info {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

.intro-link {
  color: #0066cc;
  text-decoration: none;
}

.intro-link:hover {
  text-decoration: underline;
}

/* Card footer styles */
.card-footer {
  padding: 8px 16px;
}

/* Status indicator styles */
#intro-section {
  margin-bottom: 20px;
}

.intro-title {
  margin: 0 0 20px 0;
}

.intro-content-wrapper {
  position: relative;
}

.status-indicator-float {
  float: right;
  margin: 0 0 20px 20px;
  max-width: 320px;
  min-height: 100px;
}

.status-indicator-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
  padding: 12px 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-indicator-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-title {
  margin: 0 0 6px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #14516f;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 6px;
}

.status-refresh-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #666;
  font-size: 14px;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-refresh-button:hover {
  background: #f5f5f5;
  border-color: #14516f;
  color: #14516f;
}

.status-refresh-button:active {
  transform: rotate(180deg);
}

.status-refresh-button i {
  transition: transform 0.3s ease;
}

.status-refresh-button:active i {
  transform: rotate(360deg);
}

.status-services-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-service-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.status-service-name {
  font-weight: 500;
  color: #333;
  min-width: 120px;
}

.status-uptime-inline {
  font-size: 0.85rem;
  color: #666;
  margin-left: auto;
}

.status-source {
  font-size: 0.75rem;
  color: #999;
  text-align: right;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid #e0e0e0;
}

.status-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

.status-details {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #666;
}

.status-separator {
  color: #ccc;
}

.status-uptime,
.status-response {
  white-space: nowrap;
}

.status-up {
  color: #28a745;
  font-size: 14px;
}

.status-down {
  color: #dc3545;
  font-size: 14px;
}

.status-warning {
  color: #ffc107;
  font-size: 14px;
}

/* Responsive adjustments for status indicator */
@media (max-width: 768px) {
  .status-indicator-float {
    float: none;
    margin: 0 0 20px 0;
    max-width: 100%;
  }
}

/* Loading spinner styles */
.loading-spinner-icon {
  margin-right: 10px;
}

.loading-container {
  padding: 20px;
  color: #666;
}

.loading-container-centered {
  padding: 20px;
  text-align: center;
  color: #666;
}

/* Custom mode bar button styles */
.modebar {
  padding: 5px !important;
}

.modebar-btn {
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.modebar-btn:hover {
  background-color: rgba(0, 0, 0, 0.1) !important;
}

.modebar-btn--logo {
  display: none !important;
}

/* Custom mode bar button styles */
.modebar {
  padding: 5px !important;
}

.modebar-btn {
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.modebar-btn:hover {
  background-color: rgba(0, 0, 0, 0.1) !important;
}

.modebar-btn--logo {
  display: none !important;
}