/* Global Styles */
body {
  background-color: #062442;
  color: #fff;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

/* Ensure the content section takes available space and pushes footer to bottom */
.container {
  flex: 1;
}

/* Header */
header {
  position: relative;
  width: 100%;
  padding: 10px 0;
  background-color: #062442;
  z-index: 1051;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header img {
  max-height: 50px;
}

header span {
  font-size: 24px;
}

button.btn {
  background-color: #014b8a;
  color: #fff;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
}

button.btn:hover,
button.btn:focus,
button.btn:active,
button.btn:focus-visible,
button.btn:active:focus,
button.btn:focus-visible:active,
button.btn:focus-visible:active {
  background-color: #0dd8ff;
}

.form-control:focus,
.form-control:focus-visible,
.form-control:focus-visible:active,
.form-control:focus-visible:active {
  border-color: #1e0824;
  outline: #1e0824;
  box-shadow: none;
}

.page-active {
  /* border: solid 2px #1e0824; */
  color: #0dd8ff;
  font-size: large;
}

#cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0 1rem;
}

#cards-container > div {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

/* Health cards container - responsive grid */
#health-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

/* On larger screens: two columns layout */
@media (max-width: 1600px) {
  #cards-container {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  #summary-cards {
    grid-column: 1 / -1; /* span both columns */
    grid-row: 1;
    align-self: start;
  }
  #health-cards {
    grid-column: 1 / -1; /* span both columns */
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
  }
}

/* Make cards fill their container height */
#summary-cards .card,
#health-cards .card {
  height: 100%;
  border-radius: 12px;
}

/* Footer Styling */
footer {
  background-color: #0dd8ff;
  color: #aaa;
  padding: 10px 0;
  z-index: 1051;
}

footer p {
  margin: 0;
  font-size: 14px;
}

/* Toastr Styling */
.toastr {
  position: fixed;
  z-index: 99999;
}

#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1;
}

.loader-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

/* Adjust header to be fixed at the top */
header {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1100;
}

footer {
  z-index: 1100;
}

/* Sidebar adjustments */
#sidebarMenu {
  padding-top: 15px;
  background-color: #222222;
}

/* Ensure content doesn't get hidden behind sidebar on small devices */
@media (max-width: 991px) {
  main {
    margin-left: 0 !important;
  }

  #sidebarMenu {
    width: 100%;
    top: 70px !important;
  }
}

/* Invert navbar-toggler icon for dark mode visibility */
.navbar-toggler-icon {
  /* filter: invert(1); */
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Ensure table text aligns left by default */
table.dataTable tbody td {
  text-align: left !important;
}

/* Buttons and headers responsive fix */
@media (max-width: 576px) {
  header .btn,
  header .h4 {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
  }
}

@media (min-width: 992px) {
  main {
    margin-left: 265px !important;
  }
}
