/* Application styles */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  flex: 1;
}

/* Custom Navbar Styles */
.custom-navbar {
  background-color: #e9ecef; /* Light grey background */
  color: #212529; /* Black text */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-navbar .navbar-brand,
.custom-navbar .nav-link {
  color: #212529; /* Black text */
}

.custom-navbar .nav-link:hover {
  color: #495057; /* Slightly lighter on hover */
}

.custom-navbar .nav-link.active {
  color: #0d6efd; /* Bootstrap primary color for active link */
  font-weight: 500;
}

/* Navbar toggler (hamburger button) styles */
.custom-navbar .navbar-toggler {
  border-color: rgba(0,0,0,0.1);
}

.custom-navbar .navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(0,0,0,0.1);
}

.custom-navbar .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%280, 0, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Ensure the navbar works correctly on all devices */
.custom-navbar .navbar-collapse {
  transition: all 0.3s ease;
}

/* Always collapse menu on mobile */
@media (max-width: 991.98px) {
  /* Hide the menu by default */
  .navbar-expand-lg .navbar-collapse {
    display: none !important;
  }
  
  /* Show the menu when the 'show' class is applied */
  .navbar-expand-lg .navbar-collapse.show {
    display: block !important;
  }
  
  /* Animation for the menu */
  .custom-navbar .navbar-collapse {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
  }
  
  .custom-navbar .navbar-collapse.show {
    height: auto;
    max-height: 500px; /* Adjust as needed */
  }
  
  /* Add margin to dropdown menu on mobile */
  .custom-navbar .dropdown-menu {
    margin-left: 1rem;
    border: none;
    background-color: transparent;
    box-shadow: none;
  }
}

/* Dropdown menu styles */
.custom-navbar .dropdown-menu {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.custom-navbar .dropdown-item {
  color: #212529;
}

.custom-navbar .dropdown-item:hover {
  background-color: #e9ecef;
  color: #16181b;
}

.custom-navbar .dropdown-item.active {
  background-color: #e9ecef;
  color: #0d6efd;
  font-weight: 500;
}

/* Footer Styles */
.footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
  position: relative;
  bottom: 0;
  width: 100%;
}

/* Styles for Google Charts Gauges */
.card {
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
  transition: 0.3s;
  border-radius: 5px;
}

.card:hover {
  box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
}

.card-body {
  padding: 1rem;
}

/* Flexible container for gauges and characters */
.gauges-container,
.characters-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: flex-start;
  align-items: stretch;
}

/* Individual gauge items */
.gauges-container > div {
  flex: 0 0 auto;
  margin-bottom: 20px;
}

/* Character cards grid layout */
.characters-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.character-card {
  margin-bottom: 0;
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .characters-container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gauges-container {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .characters-container {
    grid-template-columns: 1fr;
  }
  
  .gauges-container {
    flex-direction: column;
    align-items: center;
  }
  
  .gauges-container > div {
    width: 100%;
    max-width: 220px;
    margin-bottom: 15px;
  }
}

/* Pagination styles */
.pagination-container {
  margin-top: 30px;
}

.pagination {
  margin-bottom: 0;
}

.page-item.active .page-link {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.page-link {
  color: #0d6efd;
}

.page-link:hover {
  color: #0a58ca;
  background-color: #e9ecef;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1055;
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 0.5rem;
  pointer-events: none;
  max-width: 600px;
  margin: 1.75rem auto;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  outline: 0;
}

.modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem;
  border-bottom: 1px solid #dee2e6;
  border-top-left-radius: calc(0.3rem - 1px);
  border-top-right-radius: calc(0.3rem - 1px);
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  opacity: 0.5;
}

.fade {
  transition: opacity 0.15s linear;
}

.btn-close {
  box-sizing: content-box;
  width: 1em;
  height: 1em;
  padding: 0.25em 0.25em;
  border: 0;
  border-radius: 0.25rem;
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
  opacity: 0.5;
  cursor: pointer;
}

.fade.show {
  opacity: 1;
}

.modal-open {
  overflow: hidden;
}

.modal-open .modal {
  overflow-x: hidden;
  overflow-y: auto;
}
