/* Remove bottom scrollbar */
.dataTables_scrollBody {
  overflow-x: hidden !important;
}

/* Hide horizontal scrollbar (extra safety) */
.dataTables_scrollBody {
  overflow-x: hidden !important;
}

/* Make table header sticky and always show borders */
#locationTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-top: 1px solid #e0e0e0 !important;
  border-bottom: 1px solid #e0e0e0 !important;
}

/* Add left border to SDK columns for clear separation (3rd col) */
#locationTable th:nth-child(3),
#locationTable td:nth-child(3) {
  border-left: 2px solid #e0e0e0 !important;
}

/* Ensure bottom border always visible for last visible row in scroll */
.dataTables_scrollBody tbody tr:last-child td {
  border-bottom: 1px solid #e0e0e0 !important;
}

/* Left align app version in SDK columns */
#locationTable td.sdk-app-version {
  text-align: left !important;
}

/* Last column right border remove */
#locationTable th:last-child,
#locationTable tbody td:last-child,
.dataTables_scrollHead thead th:last-child,
.dataTables_scrollBody tbody td:last-child {
  border-right: none !important;
}

/* -------------------------
   Fonts & Base Styles
-------------------------- */
/* Roboto */
@font-face {
  src: url("./assets/fonts/Roboto-Bold.woff2") format("woff2");
  font-weight: 700;
  font-family: "Roboto";
}
@font-face {
  src: url("./assets/fonts/Roboto-Medium.woff2") format("woff2");
  font-weight: 500;
  font-family: "Roboto";
}
@font-face {
  src: url("./assets/fonts/Roboto-Regular.woff2") format("woff2");
  font-weight: 400;
  font-family: "Roboto";
}

body {
  background-color: #ffffff;
  font-size: 14px;
  color: #202124;
  line-height: 100%;
  font-style: normal;
  font-weight: 400;
  font-family: "Roboto", "Arial", sans-serif;
}

/* unified spacing scale */
:root {
  --section-gap: 16px;
}

.bg-color {
  background-color: #f8f9fa;
}

/* -------------------------
   Layout / Containers
-------------------------- */
.table-container {
  box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.05),
    0 3px 1px -2px rgba(0, 0, 0, 0.12),
    0 1px 5px 0 rgba(0, 0, 0, 0.2);
  background-color: #fff;
  box-sizing: border-box;
  width: 100%;
  border-right: 1px solid rgba(0, 0, 0, 0.12);
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 5px;
}

.top-bar-page {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--section-gap);
  padding: var(--section-gap);
  box-sizing: border-box;
}

.top-bar {
  background-color: #fff;
  padding: 7px 10px;
  width: 100%;
  align-items: center;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.12);
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 50%;
  gap: 12px;
}

.section-container {
  margin: 0 var(--section-gap);
  margin-bottom: var(--section-gap);
}

/* -------------------------
   Filter Buttons / Inputs
-------------------------- */
.filter-box {
  position: relative;
  display: inline-block;
}

.filter-box.apps-filter-by {
  width: auto !important;
}

.filter-box .filter-btn {
  border: 1px solid #dadce0;
  color: #5f6368;
  background-color: transparent;
  font-size: 13px;
  font-family: "Roboto", "Arial", sans-serif;
  border-radius: 50px;
  padding: 0 15px;
  line-height: 30px;
  float: left;
  margin: 2px 2px;
  transition: all 0.1s;
  text-decoration: none;
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.filter-btn.btn-active,
.filter-btn.btn-active input {
  background-color: #e0ebfc;
  color: #174ea6;
  border-color: #e0ebfc;
}

.filter-btn label,
.filter-btn > div:first-child {
  text-align: left;
  flex-shrink: 0;
}

.filter-btn .selected-options {
  flex: 1;
  text-align: left;
  margin-left: 0;
}

.filter-date label::after {
  content: ":";
  margin: 0 6px;
  color: inherit;
}

.filter-date label {
  margin-right: 0 !important;
}

.input-css {
  font-family: "Roboto", "Arial", sans-serif;
  border: none;
  cursor: pointer;
}

.input-css:focus-visible {
  outline: 0;
}

/* -------------------------
   DataTables: base behaviour
-------------------------- */
.dataTables_wrapper {
  margin-top: 0;
}

/* Hide default search + pagination + length */
.dataTables_filter,
.dataTables_info,
.dataTables_paginate,
.dataTables_length,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  display: none !important;
}

.table.dataTable {
  margin: 0 !important;
}

/* Custom search input (if ever enabled) */
#locationTable_filter input[type="search"] {
  width: 200px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

/* Custom paginate styles (if you enable it later) */
#locationTable_paginate a {
  clear: both;
  box-sizing: border-box;
  display: inline-block;
  min-width: 1.5em;
  padding: 0.5em 1em;
  margin-left: 2px;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
  color: inherit !important;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  font-size: 14px;
}

#locationTable_paginate a.current {
  background: #1967d2;
  border-color: #1967d2;
  color: #fff !important;
}

.dataTables_paginate {
  margin-top: 10px;
}

/* -------------------------
   Buttons
-------------------------- */
.apply-btn {
  background-color: #e0ebfc;
  color: #174ea6;
  border-color: #e0ebfc;
  border: none;
  border-radius: 15px;
  padding: 0 9px;
  line-height: 23px;
}

/* -------------------------
   App list in cells
-------------------------- */
.app-item {
  height: 24px;
  gap: 6px;
  overflow: hidden;
  width: 100%;
  float: left;
  display: flex;
  align-items: center;
  margin-bottom: 2.5px;
  background-color: unset !important;
}

.app-img img {
  border-radius: 5px;
  border: 0 none;
  width: 25px;
  height: 25px;
  margin-left: 1px;
}

.label-container {
  float: left;
  padding-right: 10px;
}

.primary-label-wrap,
.secondary-label-wrap {
  display: flex;
  align-items: center;
  line-height: 0;
}

.app-item .primary-label {
  font-size: 12px;
  color: #212529 !important;
}

.primary-label {
  font-family: "Roboto", "Arial", sans-serif;
  line-height: 13px;
  font-size: 12px;
  letter-spacing: 0.0142857143em;
  font-weight: 400;
  color: #3c4043;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.primary-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

/* -------------------------
   Cards (summary)
-------------------------- */
.location-summary-card {
  flex: 1 1 35%;
  min-width: 200px;
  display: flex;
  justify-content: flex-end;
  gap: var(--section-gap);
  flex-wrap: nowrap;
}

.first-card {
  background-color: #fff;
  padding: 5px 15px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dadce0;
  display: flex;
  justify-content: space-between;
}

.first-card .title-header {
  font-size: 16px;
  color: #3c4043;
  font-weight: 400;
}

.sub_title {
  font-size: 17px;
  font-weight: 400;
  color: #000;
}

.label-value {
  font-family: Roboto, Arial, sans-serif;
  line-height: 20px;
}

/* -------------------------
   Spinner
-------------------------- */
#loadingSpinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

.spinner-box {
  width: 100%;
  height: 100px;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 4px solid #3498db;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* -------------------------
   Table column widths & borders
-------------------------- */
.display-column {
  text-align: center;
  font-size: 11px;
}

.location-id {
  padding-left: 2px;
}

/* Force column widths */

/* 1st column (Id) */
#locationTable th:nth-child(1),
#locationTable td:nth-child(1) {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  text-align: center !important;
  vertical-align: middle !important;
}

/* 2nd column (App Name) */
#locationTable th:nth-child(2),
#locationTable td:nth-child(2) {
  width: 275px !important;
  min-width: 275px !important;
  max-width: 275px !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  line-height: 1.2 !important;
  text-align: left !important;
  vertical-align: middle !important;
}

/* All SDK / other columns (3rd onwards) – 60px, compact, bold */
#locationTable th:not(:nth-child(1)):not(:nth-child(2)),
#locationTable td:not(:nth-child(1)):not(:nth-child(2)) {
  width: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  text-align: left !important;
  vertical-align: middle !important;
  white-space: normal !important;
  word-break: break-word !important;
  line-height: 1.2 !important;
  font-weight: bold !important;
}

/* rows auto height */
#locationTable tbody tr,
#locationTable tbody td {
  height: 0 !important;
  padding: 10px !important;
}

/* Row + column borders */
/* Always show bottom border for all table cells, including Id, App Name, and SDK columns */
#locationTable tbody td,
#locationTable th,
.dataTables_scrollBody tbody td {
  border-bottom: 1px solid #e0e0e0 !important;
}

#locationTable thead th {
  border-top: 1px solid #e0e0e0 !important;
  border-bottom: none !important;
}

#locationTable thead th,
#locationTable tbody td {
  border-right: 1px solid #e0e0e0 !important;
}

#locationTable thead th:first-child,
#locationTable tbody td:first-child {
  border-left: 1px solid #e0e0e0 !important;
}

#locationTable thead th:last-child,
#locationTable tbody td:last-child {
  border-right: none !important;
}

/* Hover effect */
.table-container tbody tr:hover td {
  background-color: #f2f2f2 !important;
}

/* Scroll head/body borders */
.dataTables_scrollHead thead th {
  border-bottom: none !important;
  border-right: 1px solid #e0e0e0 !important;
}

.dataTables_scrollBody tbody td {
  border-bottom: 1px solid #e0e0e0 !important;
  border-right: 1px solid #e0e0e0 !important;
}

/* -------------------------
   Fixed Columns (DataTables FixedColumns)
-------------------------- */
.DTFC_LeftWrapper #locationTable th:nth-child(1),
.DTFC_LeftWrapper #locationTable td:nth-child(1) {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.DTFC_LeftWrapper #locationTable th:nth-child(2),
.DTFC_LeftWrapper #locationTable td:nth-child(2) {
  width: 275px !important;
  min-width: 275px !important;
  max-width: 275px !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  line-height: 1.2 !important;
  text-align: left !important;
  vertical-align: middle !important;
}

/* 3rd fixed column (first SDK column in fixed area) – match 60px */
.DTFC_LeftWrapper #locationTable th:nth-child(3),
.DTFC_LeftWrapper #locationTable td:nth-child(3) {
  width: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
}

.DTFC_LeftBodyWrapper table.dataTable tbody td {
  padding: 0px 0px 0px 3px !important;
}

/* -------------------------
   Low difference indicator
-------------------------- */
.low-difference-records {
  background-color: #ffcccc;
  color: #a70000;
  font-weight: bold;
}

/* -------------------------
   Custom App Filter Dropdown
-------------------------- */
.custom-dropdown {
  position: relative;
  display: inline-block;
  width: 270px;
}

#appFilterLabel {
  cursor: pointer;
  padding: 0 32px 0 15px;
}

.dropdown-label {
  padding: 8px;
  border: 1px solid #ccc;
  background-color: #fff;
  cursor: pointer;
  user-select: none;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 250px;
  border: 1px solid #ccc;
  background-color: #fff;
  z-index: 10;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dropdown-content.open {
  display: block;
}

.dropdown-search-container {
  position: sticky;
  top: 0;
}

.dropdown-search {
  width: 100%;
  padding: 8px 24px 8px 8px;
  border: none;
  border-bottom: 1px solid #ccc;
  outline: none;
  box-sizing: border-box;
}

.dropdown-options {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
}

.dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
  font-family: "Roboto", "Arial", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  user-select: none;
  overflow: hidden;
  text-overflow: ellipsis;
  color: black;
}

.dropdown-item:hover {
  background-color: #f0f0f0;
  color: #333;
}

.dropdown-item.selected {
  background-color: #1967d2;
  color: #fff;
}

.dropdown-item.selected:hover {
  background-color: #0056b3;
  color: #fff;
}

.selected-options {
  display: inline-flex;
  padding: 0 10px;
  margin-left: 10px;
  font-weight: normal;
  font-size: 14px;
}

.selected-options span {
  display: inline-block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 96px;
}

.selected-options .extra {
  color: #1967d2;
  font-weight: bold;
}

.clear-search {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  color: #888;
  display: none;
}

.clear-search:hover {
  color: #000;
}

.noResult p {
  color: rgb(95, 99, 104);
  font-size: 15px;
  padding: 10px 10px 10px 14px;
  margin: 0 !important;
}

/* -------------------------
   Responsive tweaks
-------------------------- */
@media (max-width: 1710px) {
  .top-bar {
    min-width: 280px;
  }
}

@media (max-width: 1350px) {
  .first-card {
    display: block;
  }

  .first-card .title-header {
    font-size: 14px;
  }

  .sub_title {
    font-size: 15px;
  }
}

@media (max-width: 1024px) {
  .first-card {
    flex-direction: column;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .location-summary-card {
    flex-wrap: nowrap !important;
    gap: 8px;
    min-width: 150px;
  }

  .first-card {
    min-width: 100px;
    padding: 4px 6px;
  }

  .first-card .title-header {
    font-size: 11px;
  }

  .sub_title {
    font-size: 12px;
  }

  #dateRange {
    max-width: 100%;
    font-size: 12px;
    padding: 10px;
  }

  .filter-btn {
    width: fit-content;
  }
}

@media (max-width: 450px) {
  .select2-dropdown,
  .select2-container {
    width: 200px !important;
  }
}

@media (max-width: 320px) {
  .filter-box {
    width: 100% !important;
    max-width: 100% !important;
  }

  .filter-box .filter-btn {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 11px !important;
    flex-wrap: nowrap !important;
    overflow: hidden !important;
  }

  .top-bar {
    padding: 3px !important;
    gap: 5px !important;
    flex-wrap: wrap !important;
  }

  .top-bar-page {
    padding: 5px !important;
  }

  .location-summary-card {
    flex-wrap: nowrap !important;
    gap: 20px !important;
    width: 100% !important;
    justify-content: space-between !important;
  }

  .first-card {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 3px 4px !important;
  }

  .first-card .title-header {
    font-size: 9px !important;
  }

  .sub_title {
    font-size: 10px !important;
  }
}

@media (min-width: 375px) {
  .table-spacing {
    margin: 0px 16px;
  }
}
