.timeline-header-cell.day-border,
.timeline-cell.day-border {
  border-left: 2px solid #888 !important;
  z-index: 2;
  position: relative;
}

.timeline-header-cell.last-day,
.timeline-cell.last-day {
  border-right: 2px solid #888 !important;
}

.timeline-header-cell.interval-border,
.timeline-cell.interval-border {
  border-left: 1px solid #bbb;
  z-index: 1;
}

body {
  display: flex;
  justify-content: center; /* center horizontally */
  align-items: center;     /* center vertically */
  height: 100vh;           /* full viewport height */
  margin: 0;
}

#iconModal .modal-dialog {
  max-width: 250px; /* adjust width as needed */
}

#iconModalBody img {
  max-height: 100px; /* make degree/fire image taller */
  width: auto;       /* keep aspect ratio */
}

.img-fluid {
  max-width: 48px;
  height: auto;
  margin: 2px;
  display: inline-block;
}

.ipma-widget {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 0.6rem;
  font-family: system-ui;
  color: black;
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  gap: 0rem;
  box-shadow: 0 3px 8px rgba(169, 168, 168, 0.08);
  position: relative;
}

.info-container {
  display: flex;
  flex-direction: row;
  gap: 0.8rem;
}

/* Top-left logos */
.logos-container {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.logos-container img {
  width: 6rem;
  object-fit: contain;
}

/* Center: weather icon and temperature */
.weather-center {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.weather-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

#current-logo {
  width: 4.5rem; /* slightly smaller for compact widget */
}

.temperature {
  font-size: 2rem;
  font-weight: 400;
  align-self: center;
  text-align: center;
  margin: 0;
  line-height: 1;
}

.precipitation {
  font-size: 0.6rem;
  color: rgb(92, 92, 92);
  font-weight: 400;
  align-self: flex-end;
  text-align: end;
}

/* Footer row with time and icons */
.widget-footer {
  display: flex;
  flex-direction: row;
  gap: 0.1rem;
}

/* Date/time on left, bottom-left */
.datetime {
  font-size: 0.5rem;
  opacity: 0.7;
  align-self: center;
}

/* Icons container positioned above the bottom */
.icons {
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  /* border: 1px solid black; */
}

.icons i,
.icons img {
  width: 1.4rem;
  cursor: pointer;
  opacity: 0.8;
  transition: transform 0.2s;
  align-self: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.icons a {
  text-decoration: none;
}

.icons i:hover,
.icons img:hover {
  transform: scale(1.2);
}

#ic-logo {
  width: 0.7rem;
  object-fit: contain; 
}

/* Tooltip for warnings */
.warning-tooltip-container {
  position: relative;
  display: inline-block;
}

.warning-tooltip-content {
  display: none;
  position: absolute;
  top: 110%;                 /* BELOW the icon */
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 0.5rem;
  border-radius: 5px;
  font-size: 0.75rem;
  width: auto;
  min-width: 50vw;
  /* max-width: 250px !important; */
  text-align: left;
  z-index: 10;
  white-space: pre-wrap;
  line-height: 1.2;
}

.warning-tooltip-container:hover .warning-tooltip-content {
  display: block;
}

/* Arrow pointing UP */
.warning-tooltip-content::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent rgba(0,0,0,0.85) transparent;
}


/* Both tooltips */
.weather-tooltip-content p, .warning-tooltip-container p {
  margin: 0;
}

/* Arrow */
.weather-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

/* Show on hover */
.weather-tooltip-container:hover .weather-tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.weather-tooltip-container {
  position: relative;
  display: inline-block;
}

.weather-tooltip-content {
  display: none; /* hidden by default */
  position: absolute;
  top: -5px; /* adjust as needed */
  left: 110%; /* position to the right of the icon */
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 8px;
  border-radius: 5px;
  max-width: 200px;
  z-index: 10;
  font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.weather-tooltip-container:hover .weather-tooltip-content {
  display: block;
}
/* Warnings Timeline Popover Styles */
#warning-icon {
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

#warning-icon:hover {
  transform: scale(1.2);
  filter: brightness(0.9);
}

.warnings-timeline-popover {
  position: fixed;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 10000;
  animation: popoverSlideIn 0.2s ease-out;
  max-width: 900px;
  min-width: 750px;
  max-height: 95vh;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

@keyframes popoverSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.popover-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 500px;
  background: linear-gradient(135deg, #f8fafc 0%, #f5f7fa 100%);
}

.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.popover-header h3 {
  margin: 0;
  padding: 5px;
  font-size: 16px;
  font-weight: 600;
  color: #222;
}

.popover-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.popover-close-btn:hover {
  background-color: #f0f0f0;
  color: #333;
}

.popover-timeline {
  flex: 1;
  overflow: auto;
  padding: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}

.timeline-table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 500px;
}

.timeline-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: white;
}

.timeline-table thead {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
  border-bottom: 2px solid #2563eb;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.timeline-header-label {
  padding: 4px 8px;
  font-weight: 600;
  font-size: 12px;
  color: #1f2937;
  text-align: left;
  border-right: 1px solid #e5e7eb;
  background: #f9fafb;
  width: 40px;
  height: 20px;
  vertical-align: middle;
}

.timeline-header-cell {
  padding: 0px 2px;
  font-size: 11px;
  font-weight: 500;
  color: #374151;
  text-align: center;
  border-right: 1px solid #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 8px;
  max-width: 8px;
  width: 8px;
  height: 20px;
  vertical-align: middle;
}

.timeline-header-cell.hour-left {
  text-align: left;
}

.timeline-header-cell:last-child {
  border-right: none;
}

.timeline-row {
  border-bottom: 1px solid #e5e7eb;
  height: 20px;
  vertical-align: middle;
}

.timeline-row:nth-child(odd) {
  background: #ffffff;
}

.timeline-row:nth-child(even) {
  background: #f9fafb;
}

.timeline-row:hover {
  background: #f3f4f6;
}

.timeline-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid #e5e7eb;
  background: #f9fafb;
  vertical-align: middle;
  margin: 5px;
  padding: 0;
}

.timeline-label i {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  min-height: 15px;
  font-size: 18px;
}

.timeline-cell {
  min-width: 10px;
  max-width: 10px;
  width: 10px;
  padding: 2px;
  border-right: 1px solid #e5e7eb;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  height: 20px;
  vertical-align: middle;
}

.timeline-cell:last-child {
  border-right: none;
}

.timeline-cell.active {
  opacity: 0.85;
  border-radius: 3px;
  margin: 2px 2px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.timeline-cell.active:hover {
  opacity: 1;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Severity color classes */
.timeline-cell.severity-red {
  background-color: #dc2626;
}

.timeline-cell.severity-orange {
  background-color: #f97316;
}

.timeline-cell.severity-yellow {
  background-color: #fbbf24;
}

.timeline-cell.severity-green {
  background-color: #10b981;
}

.timeline-tooltip {
  position: fixed;
  background: #1f2937;
  color: white;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 10001;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
  white-space: normal;
  max-width: 320px;
  border: 1px solid #374151;
}

/* Ensure Font Awesome is loaded for icons */
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css");

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}