/* General styles */

/* Reset & Base Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-base); /* 18px base - Design System */
  line-height: var(--line-height-base); /* 1.7 spacing - Design System */
  letter-spacing: var(
    --letter-spacing-base
  ); /* Enhanced clarity - Design System */
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h2 {
  font-size: var(--font-size-xl); /* 22px - compliant with design brief */
}

h3 {
  font-size: var(--font-size-lg); /* 20px */
}

p {
  margin: 0 0 var(--spacing-md) 0;
  color: var(--text-primary);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition-standard); /* Design System transition */
}

body {
  font-family: Arial, sans-serif;
  background-color: #333 !important;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* input[type="number"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="reset"],
input[type="tel"],
input[type="date"],
select {
  all: unset;
} */

.ast-container {
  max-width: 100% !important;
}

.page-header {
  display: none;
}

.wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: auto;
  color: white; /* Move color white to wrapper */
  max-width: 100% !important;
}

#content-container {
  color: black;
}

::-webkit-scrollbar-corner {
  background: rgba(0, 0, 0, 0);
}

[name="selectForm"] {
  padding: 10px;
  width: 60%;
  max-width: 300px;
}

.container1 {
  display: flex;
  flex: 1;
  flex-direction: row;
  overflow-x: hidden;
}

.sidebar {
  flex: 0 1 30%;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  /* border-radius: 8px; */
  overflow-x: auto;
  justify-content: space-between;
}

#mapLogo {
  margin-bottom: 5px;
}

#date-input {
  text-align: center;
  /* background-color: #333; */
  padding: 5px;
  border-radius: 8px;
  background: #444;
  border: 1px solid #555;
  margin-left: 10px;
  margin-top: 0px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#map {
  flex: 1;
  background-color: #e5e5e5;
  /* margin: 1rem; */
  /* border-radius: 8px; */
  min-height: 300px;
  margin-top: 20px;
  border-radius: 8px;
}

.status-panel {
  flex: 0 1 216px;
  /* padding: 1rem; */
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  /* border-radius: 8px; */
}

.gm-style-iw-chr button {
  height: 0px !important;
  width: auto; /* Ensure the width is not constrained by height */
  display: flex; /* Use flex to center the content */
  align-items: center; /* Center vertically */
  justify-content: center; /* Center horizontally */
  display: none;
}

.gm-style-iw-chr {
  opacity: 0;
}

#current-day {
  color: #00bcd4;
}

.tabs {
  display: flex;
  margin-bottom: 1rem;
  justify-content: center;
  align-items: center;
}

.unclickabletr {
  cursor: not-allowed;
}
/* .tab-button {
    flex: 1;
    background-color: #444;
    color: white;
    font-weight: bold;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    margin-right: 0.5rem;
    margin-left: 0.5rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border-radius: 8px;
} */

.tab-button.active {
  background-color: #00bcd4;
  color: white;
  font-weight: bold;
  outline: none;
}

.not-allowed {
  color: red;
  cursor: not-allowed;
}

/* .tab-button {
    margin: 0.5rem;
    text-align: center;
    background-color: #3b3b3b;
    padding: 1rem;
    border-radius: 8px;
    color: #f1f1f1;
    border: 1px solid #555;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s, border 0.3s;
    cursor: pointer;
    transition: transform 0.5s, box-shadow 0.5s;
    margin-right: 0.5rem;
    margin-left: 0.5rem;
    width: 40%;
} */

.tab-button:hover {
  background-color: #444;
  /* border: 1px solid #777; */
  /* transform: scale(1.05); */
}

.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  margin: 0.5rem;
}

/* Custom vertical scrollbar with colors */
.tab-content::-webkit-scrollbar {
  width: 12px; /* Changed from height to width for vertical scrollbar */
  position: absolute; /* Position the scrollbar */
  bottom: 0; /* Align to the bottom */
  right: 0; /* Align to the right */
}

.tab-content::-webkit-scrollbar-thumb {
  background-color: #00bcd4; /* Color of the scrollbar thumb */
  border-radius: 6px; /* Rounding the scrollbar thumb edges */
}

.tab-content::-webkit-scrollbar-track {
  background-color: #333; /* Color of the scrollbar track */
  border-radius: 6px; /* Rounding the scrollbar track edges */
  margin-bottom: 60px; /* Add margin at the bottom to create space for the date input */
}

.tab-content.active {
  display: block;
}

.table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 8px;
}

.table th,
.table td {
  border: 1px solid #555;

  /* padding: 0.75rem; */
  /* text-align: left; */
}

.daterangepicker th,
.daterangepicker tr,
.daterangepicker td {
  padding: 5px;
}

.locations-table td,
.locations-table th {
  padding: 15px;
}

.table tr {
  text-align: center;
  font-size: 0.8em;
}

.color-indicator {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
}

.blue {
  background-color: #00bcd4;
}

/* .status-item {
    margin-bottom: 1rem;
    background-color: #444;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
} */

.status-item {
  text-align: center;
  background-color: #3b3b3b;
  padding: 1rem;
  border-radius: 8px;
  color: #f1f1f1;
  border: 1px solid #555;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s, border 0.3s;
  transition: transform 0.5s, box-shadow 0.5s;
}

/* Status Item Hover */
.status-item:hover {
  background-color: #444;
  border: 1px solid #777;
  /* transform: scale(1.1); */
  z-index: 10; /* Ensure it stays below the tooltip */
}

.status-item .label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

/* Battery Indicator */
.battery-indicator {
  /* background-color: #555; */
  border-radius: 8px;
  width: 100%;
  height: 50px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 0.875rem;
}

#battery_status {
  height: 35px;
}

.selected {
  background: #2ec0ce;
}

.battery-level {
  height: 100%;
  border-radius: 8px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1; /* Ensure battery level is below the text */
}

.battery-level-text {
  padding: 5px;
  z-index: 2; /* Ensure battery text is above battery level but below the tooltip */
}

/* Increase the size of the switch */
.switch {
  position: relative;
  display: inline-block;
  width: 51px; /* 150% of 34px */
  height: 30px; /* 150% of 20px */
  margin-top: 0.4rem;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sliderE,
.sliderW {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 30px; /* 150% of 20px */
}

.sliderE:before,
.sliderW:before {
  position: absolute;
  content: "";
  height: 21px; /* 150% of 14px */
  width: 21px; /* 150% of 14px */
  left: 4.5px; /* 150% of 3px */
  bottom: 4.5px; /* 150% of 3px */
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .sliderE {
  background-color: #f3212d;
}

a {
  outline: none;
}

input:checked + .sliderW {
  background-color: #4ecc00;
}

input:checked + .sliderE:before,
input:checked + .sliderW:before {
  transform: translateX(21px); /* 150% of 14px */
}

.footer {
  background-color: #333;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 125px;
  /* border-radius: 8px; */
  /* flex-wrap: wrap; */
}

.footer-item {
  flex: 1;
  margin: 0.5rem;
  text-align: center;
  background-color: #3b3b3b;
  padding: 1rem;
  border-radius: 8px;
  color: #f1f1f1;
  border: 1px solid #555;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s, border 0.3s;
  transition: transform 0.5s, box-shadow 0.5s;
}

.footer-item:hover {
  background-color: #444;
  border: 1px solid #777;
  /* transform: scale(1.05); */
}

.parameter-name {
  color: #00bcd4;
  font-weight: bold;
}

.parameter-value {
  color: white;
  font-size: 0.875rem;
  padding-top: 1.45%;
  padding-bottom: 1.45%;
}

#tracker-history {
  text-align: center;
  border-radius: 8px;
}

/* Media query for mobile view */
@media only screen and (max-width: 1024px) {
  .wrapper {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "map"
      "footer"
      "status-panel"
      "sidebar";
    overflow-y: auto;
  }

  .gm-style-mtc button {
    padding: 0px 10px !important;
  }

  .container1 {
    display: contents;
  }

  .locations-table tr {
    display: flex;
  }

  .container1 .sidebar {
    grid-area: sidebar;
    /* width: 100%; */
    margin-bottom: 1rem;
  }

  .container1 #map {
    grid-area: map;
    min-height: 500px;
    /* margin: 0.35rem 0 0.35rem 0; */
    padding: 1rem;
    margin: 5px;
  }

  .container1 .status-panel {
    grid-area: status-panel;
    /* margin-bottom: .4rem; */
  }

  .container2 {
    /* margin: 0.5rem 0; */
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 10px;
    padding: 10px;
  }
  .footer-item:nth-child(5) {
    grid-column: span 2;
    justify-self: center;
  }

  .footer-item {
    width: 100%;
    box-sizing: border-box; /* Ensure padding and border are included in width */
    margin: 0;
    height: 90%;
  }

  .footer {
    margin-top: 0;
  }

  .status-panel {
    display: grid;
    /* grid-template-columns: 1fr 1fr; */
    grid-gap: 10px;
    padding: 0 10px 0 10px;
  }

  .status-item:nth-child(2) {
    grid-column: span 2;
    justify-self: center;
  }

  .status-item {
    background-color: #3b3b3b;
    /* padding: 0.75rem; */
    border-radius: 8px;
    text-align: center;
    /* width: 100%; */
    box-sizing: border-box;
    margin-bottom: 0;
  }

  #tracker-search {
    text-align: center;
    font-size: 12px;
  }

  #day-date-time {
    display: none;
  }

  .tabs {
    flex-direction: row;
  }

  .locations-tab thead tr {
    display: flex; /* Uses flexbox for header row */
  }

  /* .tab-button {
        margin: 0.25rem 0;
    } */

  .table th,
  .table td {
    /* padding: 0.5rem; */
    font-size: 0.75rem;
  }

  .sidebar {
    overflow-x: visible;
  }
  #date-input {
    margin: 0.5rem;
  }
  .table-wrap {
    margin-top: 0.2rem;
  }

  .sidebar {
    height: fit-content; /* Full viewport height */
    display: flex;
    flex-direction: column-reverse; /* date-picker at top */
    overflow: hidden; /* Prevent sidebar from scrolling */
  }

  .tab-content {
    margin-left: 10px;
    margin-right: 10px;
  }

  .tabs {
    flex-shrink: 0; /* Prevent tabs from shrinking */
  }

  .active .locations-tab {
    flex-grow: 1;
    overflow: hidden; /* Hide overflow */
    display: flex;
    flex-direction: column;
  }

  .locations-tab .locations-table {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 600px;
  }

  .locations-tab .locations-table thead {
    flex-shrink: 0; /* Prevent header from shrinking */
  }

  .locations-table {
    flex-grow: 1;
    overflow-y: auto; /* Allow vertical scrolling */
  }

  /* Ensure all table cells have consistent width */
  .locations-tab .locations-table th,
  .locations-tab .locations-table td {
    width: 16.66%; /* For 6 columns, adjust if number of columns changes */
    min-width: 100px; /* Minimum width for each column */
  }

  /* ↓↓↓↓↓↓ Custom horizontal scrollbar with colors ↓↓↓↓↓↓↓ */
  .locations-table::-webkit-scrollbar {
    height: 12px; /* Adjust the height of the scrollbar */
  }

  .locations-table::-webkit-scrollbar-thumb {
    background-color: #00bcd4; /* Color of the scrollbar thumb */
    border-radius: 6px; /* Rounding the scrollbar thumb edges */
  }

  .locations-table::-webkit-scrollbar-track {
    background-color: #333; /* Color of the scrollbar track */
    border-radius: 6px; /* Rounding the scrollbar track edges */
  } /*↑↑↑↑↑↑↑ Custom horizontal scrollbar with colors ↑↑↑↑↑↑↑*/

  .container2 {
    order: -1; /* First after Map */
    height: auto;
  }

  .referral {
    grid-column: span 2;
    justify-self: center;
    width: 100%;
  }

  .battery-item {
    width: 100%;
  }
}

.tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
  color: white; /* Color for the icon */
  margin-left: 5px; /* Adjust margin as needed */
}

/* Tooltip text */
.tooltip .tooltiptext {
  visibility: hidden;
  font-size: 15px;
  width: 150px; /* Adjust width as needed */
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  position: absolute;
  z-index: 30; /* Higher z-index to ensure it appears above other elements */
  bottom: 125%; /* Position the tooltip above the text */
  left: 50%;
  transform: translateX(-80%); /* Center the tooltip horizontally */
  opacity: 0;
  transition: opacity 0.3s;
}

/* Tooltip text visibility on hover */
.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

.tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.tooltip .tooltip-icon {
  background-color: #00bcd4;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: black;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;

  z-index: 30; /* Higher z-index to ensure it appears above other elements */
  bottom: 125%; /* Position the tooltip above the text */
  left: 50%;
  transform: translateX(-80%); /* Center the tooltip horizontally */
  opacity: 0;
  transition: opacity 0.6s;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}
/* tooltip css ends here */

/* Position Tracker History under Table */
.container1 {
  position: relative;
}

/* Styles for desktop view */
@media screen and (min-width: 1025px) {
  body {
    height: 100vh;
  }
  #date-input {
    /* position: absolute; */
    /* bottom: 10px; */
    /* left: 0 */
    /* width: 29%; */
    height: 60px;
    margin-right: 10px;
    /* margin-left: 1%; */
  }

  .box.sidebar {
    /* height: calc(100% - 70px); */
  }

  .status-item {
    margin: 0.5rem;
  }

  .wrapper {
    height: 90vh;
  }
}

#tracker-history {
  width: 75%;
  font-size: 12px;
  padding: 0px;
  height: fit-content;
}
/* End Tracker History */

.box.sidebar {
  display: flex;
  flex-direction: column;
  /* height: calc(100% - 70px); */
}

.table-wrap {
  flex-grow: 1;
  overflow: hidden;
  display: flex;
  border: 1px solid #555;
  border-radius: 8px;
  background-color: #3b3b3b;
  flex-direction: column;
  margin: 10px;
}

.site-footer {
  display: none;
}

/* .status-item {
    margin: 0.5rem;
    text-align: center;
    background-color: #3b3b3b;
    padding: 1rem;
    border-radius: 8px;
    color: #f1f1f1;
    border: 1px solid #555;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s, border 0.3s;
    transition: transform 0.5s, box-shadow 0.5s;
} */

/* .tab-content {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
} */

.tab-content table {
  flex-grow: 1;
}

.tab-content thead {
  position: sticky;
  top: 0;
  background-color: #333;
  z-index: 1;
}

/* Make Table Grabbable */
.tab-content {
  flex-grow: 1;
  overflow: auto;
  cursor: default; /* Changed from grab to default */
  /* Removed user-select: none; */
}

.tab-content:active {
  cursor: grabbing;
}

/* Add styles for when not selecting text */
.tab-content.draggable {
  cursor: grab;
}

.tab-content.draggable:active {
  cursor: grabbing;
}

#referral-code {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 10px;
}

.code-tile {
  display: flex;
  justify-content: center;
  align-items: center;

  height: 30px;
  width: 30px;

  background-color: #444;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid #555;
}

.status-item:hover .code-tile {
  background-color: #333;
  transition: background-color 0.3s ease; /* Smooth transition for hover effect */
}

.tabs {
  display: flex;
  background-color: #333;
  border-radius: 20px;
  overflow: hidden;
  width: fit-content;
  margin: 10px auto;
}

.tab-button {
  background-color: transparent;
  border: none;
  color: #999;
  padding: 10px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  outline: none;
}

.tab-button:focus {
  outline: none; /* Ensures no outline when focused/clicked */
}

.tab-button.active {
  background-color: #00bcd4;
  color: white;
}

.tab-icon {
  background-color: #00bcd4;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  font-weight: bold;
}

.tab-button:not(.active) .tab-icon {
  background-color: #555;
}

.tab-text {
  font-weight: bold;
}

.label-container {
  display: flex;
  align-items: center; /* Vertically center items */
  justify-content: space-between;
  width: 100%;
}

.label-container label {
  flex: 0 1 100%;
  /*margin-right: 10px; */ /* Add some space between label and tooltip */
}

.label-container .tooltip {
  flex: 0 1 10%;
  display: flex;
  justify-content: center; /* Center the tooltip icon horizontally */
}

.deviceColor {
  width: 25px;
  height: 25px;
  margin: auto;
  border-radius: 15px;
}

#devSelect {
  box-shadow: rgba(0, 0, 0, 0.3) 0px 1px;
  border: 0px;
}

/* Define the fade-out animation */
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Class to apply fade-out effect and hide the element */
.fade-out {
  animation: fadeOut 1s forwards; /* 1s duration for the fade-out effect */
  display: none; /* Hide the element */
  opacity: 0; /* Ensure opacity is 0 at the end of the animation */
}

/* Define the fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Class to apply fade-in effect */
.fade-in {
  animation: fadeIn 1s forwards; /* 1s duration for the fade-in effect */
  display: block; /* Ensure the element is displayed */
  opacity: 1; /* Ensure opacity is 1 at the end of the animation */
}
