* {
  box-sizing: border-box;
}

html {
  height: 100%;
  display: flex;
  flex-direction: column;
}
body {
  background-color: #f5f6f8;
  color: #3b3b3b;
  font-size: 14px;
  font-weight: 300;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    "Helvetica Neue", "Ubuntu", sans-serif;
  justify-content: center;
  line-height: 22px;
  margin: 0;
  padding: 0;
  text-align: center;
  transition: opacity 0.3s;
}
h1,
h2,
h3,
h4,
h5,
h6,
button,
footer,
input,
textarea,
.copyright,
.button {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    "Helvetica Neue", "Ubuntu", sans-serif;
  line-height: 125%;
}

h1 {
  color: #3b3b3b;
  font-size: 32px;
  font-weight: bold;
  margin: 0px;
}
h2 {
  color: #3b3b3b;
  font-size: 28px;
  font-weight: bold;
  margin: 16px 0 8px 0;
}
h3 {
  color: #3b3b3b;
  font-size: 24px;
  font-weight: 700;
  margin: 8px 0 4px 0;
}
h4 {
  color: #3b3b3b;
  font-size: 18px;
  font-weight: 600;
  margin-top: 5px;
  margin-bottom: 4px;
}
h5 {
  color: #3b3b3b;
  font-size: 16px;
  font-weight: bold;
  margin-top: 5px;
  margin-bottom: 4px;
}
h6 {
  color: #3b3b3b;
  font-size: 16px;
  font-weight: bold;
  margin-top: 5px;
  margin-bottom: 4px;
}
a {
  color: #194b7d;
  text-decoration: none;
}

.outlineButton,
.button,
button {
  background-color: #194b7d;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 16px;
  white-space: nowrap;
}

footer {
  color: #9c9c9c;
  margin: 40px;
}

footer a {
  font-weight: bold;
}

.pageContainer {
  padding: 30px 50px;
  background-color: #fff;
  box-shadow: 0px 6px 18px rgba(0, 0, 0, 0.06);
  border-radius: 5px;
  max-width: 900px;
  width: 100%;
  margin: 96px auto;
}

.headline {
  display: flex;
  align-items: center;
  justify-content: center;
}

.headline span {
  background-color: #f5f6f8;
  border-radius: 5px;
  padding: 6px;
  margin-left: 12px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

.systemStatusContainer {
  margin: 30px auto 0;
  width: 100%;
}

.reportContainer {
  margin: 30px auto;
  width: 100%;
}

.statusContainer {
  border: 1px solid #ededed;
  border-radius: 5px;
  padding-top: 20px;
  text-align: left;
  padding: 24px;
}

.statusContainer + .statusContainer {
  border-top: 1px solid #eee;
  margin-top: 30px;
}

.statusStreamContainer {
  display: flex;
  justify-content: space-between;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 5px;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f5f5f5;
  position: relative;
}

/* Gradient overlay untuk menunjukkan ada scroll */
.statusStreamContainer::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 5px;
  width: 30px;
  background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.statusStreamContainer.has-scroll::after {
  opacity: 1;
}

.statusStreamContainer::-webkit-scrollbar {
  height: 6px;
}

.statusStreamContainer::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 3px;
}

.statusStreamContainer::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.statusStreamContainer::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.statusSquare {
  border-radius: 3px;
  height: 30px;
  min-width: 4px;
  max-width: 20px;
  width: 100%;
  flex: 1 1 auto;
}

.statusSquare + .statusSquare {
  margin-left: 6px;
}

.sectionUrl {
  font-size: 14px;
}

.statusTitle {
  text-transform: uppercase;
}

.statusHeader {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-bottom: 2px;
}

.statusSubtitle {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-bottom: 12px;
}

.statusHeadline {
  color: #eee;
  padding: 4px 8px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 12px;
}

.statusUptime {
  flex: 1;
  text-align: right;
  color: #7c7c7c;
  font-size: 12px;
}

.uptimeContainer {
  color: #999;
  display: flex;
  margin-top: 8px;
  font-size: 12px;
}

.uptimeContainer hr {
  border: none;
  border-top: 1px dashed #eee;
  width: 100%;
  margin: 10px;
}

.success {
  background-color: #4cae50;
  color: #fff;
}

.failure {
  background-color: #f44336;
  color: #fff;
}

.nodata {
  background-color: #f8f8f8;
  color: #ccc;
}

.partial {
  background-color: #ff9800;
  color: #fff;
}

/* System Status Banner Styles */
.systemStatus {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.systemStatus .statusIcon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.systemStatus .statusInfo {
  flex: 1;
  text-align: left;
}

.systemStatus .statusTitle {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #ffffff;
}

.systemStatus .statusDetail {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
}

/* Status Operational - Hijau */
.statusOperational {
  background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
  border-left: 5px solid #2e7d32;
}

/* Status Degraded - Oranye */
.statusDegraded {
  background: linear-gradient(135deg, #ff9800 0%, #ffa726 100%);
  border-left: 5px solid #f57c00;
}

/* Status Down - Merah */
.statusDown {
  background: linear-gradient(135deg, #f44336 0%, #ef5350 100%);
  border-left: 5px solid #c62828;
}

/* Status Incident Info */
.statusIncidentInfo {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.statusIncidentInfo small {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.95);
}

.statusIncidentInfo a {
  color: rgba(255, 255, 255, 1);
  text-decoration: underline;
  font-weight: 500;
}

.statusIncidentInfo a:hover {
  color: rgba(255, 255, 255, 0.8);
}

.tooltip {
  background-color: #fff;
  box-shadow: 0px 6px 18px rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  color: #3b3b3b;
  font-size: 12px;
  line-height: 18px;
  padding: 16px;
  position: absolute;
  text-align: left;
  z-index: 100;
  width: 240px;
  transition: opacity 0.2s;
  pointer-events: none;
}

.tooltip .tooltipArrow {
  position: absolute;
  bottom: 100%;
  width: 4px;
  text-align: center;
  border: 4px solid transparent;
  border-bottom-color: #fff;
  left: 50%;
  margin-left: -2px;
}

.tooltip .tooltipDateTime {
  font-size: 12px;
  color: #7c7c7c;
  text-transform: uppercase;
  font-weight: 600;
}

.tooltip .tooltipKey {
  color: #ccc;
  font-size: 10px;
}

.tooltip .tooltipDescription {
  margin-top: 12px;
  font-size: 14px;
  color: #181818;
}

.tooltip #tooltipStatus {
  padding: 4px 8px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: bold;
  margin-top: 6px;
  display: inline-block;
}

.tooltip hr {
  border: none;
  border-top: 1px solid #ededed;
  margin-top: 16px;
}

/* Chart Container Styles */
.chartContainer {
  background-color: #fff;
  border: 1px solid #ededed;
  border-radius: 5px;
  padding: 24px;
  margin: 30px auto;
  width: 100%;
}

.chartHeaderWrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.chartTitle {
  color: #3b3b3b;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  text-align: left;
  flex: 1;
  min-width: 200px;
}

.chartTimeToggle {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.timeToggleBtn {
  padding: 0;
  border: none;
  background-color: transparent;
  color: #7c7c7c;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.timeToggleBtn:hover {
  color: #194b7d;
  text-decoration-thickness: 2px;
}

.timeToggleBtn.active {
  color: #194b7d;
  font-weight: 600;
  text-decoration-thickness: 2px;
}

.timeToggleBtn:focus {
  outline: none;
  text-decoration-thickness: 2px;
}

.chartWrapper {
  position: relative;
  height: 300px;
  margin-bottom: 16px;
}

.chartLegend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 12px;
}

.chartLegend .legendItem {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chartLegend .legendColor {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

@media screen and (max-width: 800px) {
  .pageContainer {
    padding: 30px 20px;
    margin: 0 auto 40px auto;
  }

  .statusHeader,
  .statusSubtitle {
    display: block;
  }

  .statusHeadline,
  .sectionUrl,
  .statusUptime {
    margin-left: 0;
    margin-top: 8px;
    text-align: left;
  }

  .statusTitle,
  .statusHeadline {
    display: inline-block;
  }

  .statusSquare + .statusSquare {
    margin-left: 2px;
  }

  .statusSquare {
    min-width: 3px !important;
    max-width: 15px !important;
    flex: 1 1 auto !important;
  }
  
  .chartHeaderWrapper {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .chartTitle {
    width: 100%;
    margin-bottom: 12px;
  }
  
  .chartTimeToggle {
    width: 100%;
  }
  
  .timeToggleBtn {
    flex: 1;
    min-width: 70px;
  }
  
  .chartWrapper {
    height: 250px;
  }
  
  .systemStatus {
    padding: 16px 18px;
    gap: 12px;
  }
  
  .systemStatus .statusIcon {
    font-size: 24px;
  }
  
  .systemStatus .statusTitle {
    font-size: 16px;
  }
  
  .systemStatus .statusDetail {
    font-size: 13px;
  }
}
