/* Define CSS variables */
:root {
  --navbar_height: 50px;
  --bottombar_height: 50px;
  --sidebar_closed_width: 55px;
  --sidebar_opened_width: 325px;
}

/* Some scheme specific colors */
:root[data-mantine-color-scheme="dark"] {
  --main-card-header-bg: var(--mantine-color-dark-9);
  --main-card-bg: var(--mantine-color-dark-8);
}

/* Small ones */
.clickable {
  cursor: pointer;
  display: flex;
  align-items: center;
}

.topRowButton {
  height: 30px;
  padding-left: 10px;
  padding-right: 10px;
}

/* Main Page Layout classes */
.navbar {
  padding-left: 8px;
  padding-right: 8px;
  height: var(--navbar_height);
  top: 0;
  width: 100%;
  position: fixed;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bottombar {
  padding-left: 8px;
  padding-right: 8px;
  height: var(--bottombar_height);
  top: var(--navbar_height);
  min-width: 100%;
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
}

.sidebar-closed {
  top: calc(var(--navbar_height) + var(--bottombar_height));
  padding: 15px 15px 10px 15px;
  height: calc(100vh - var(--navbar_height) - var(--bottombar_height));
  transition: width 0.5s;
  position: fixed;
  overflow-y: auto;
  width: var(--sidebar_closed_width);
}

.sidebar-opened {
  top: calc(var(--navbar_height) + var(--bottombar_height));
  padding: 15px 15px 10px 15px;
  height: calc(100vh - var(--navbar_height) - var(--bottombar_height));
  transition: width 0.5s;
  position: fixed;
  overflow-y: auto;
  width: var(--sidebar_opened_width);
}

.mainContent-opened {
  transition: margin-left 0.5s;
  left: var(--sidebar_opened_width);
  top: calc(var(--navbar_height) + var(--bottombar_height));
  padding: 15px 20px 0px 20px;
  position: fixed;
  width: calc(100% - var(--sidebar_opened_width));
  max-height: calc(100% - var(--navbar_height) - var(--bottombar_height));
  overflow-y: auto;
}

.welcome-screen {
  top: calc(var(--navbar_height) + var(--bottombar_height));
  position: fixed;
  width: 100%;
  height: calc(100% - var(--navbar_height) - var(--bottombar_height));
  overflow-y: auto;
  z-index: 100;
  background-color: var(--mantine-color-body);
  display: flex;
  justify-content: center;
  padding-top: 50px;
  padding-bottom: 50px;
}

.dark-mode-1 {
  background-color: var(--mantine-color-dark-9);
  border: 1px solid #3b3b3b;
}

.light-mode-1 {
  background-color: #faf9f9;
  border: 1px solid #e0e0e0;
}

/* Main content styles */
.mainContent-fullPage {
  /* display: inline-block !important; */
  height: calc(
    100vh - var(--navbar_height) - var(--bottombar_height) - 55px
  ) !important;
  /* 50px is the height of the title */
  padding-bottom: 5px;
  width: 100% !important;
}

.mainContent-fullPage_output {
  /* display: inline-block !important; */
  height: calc(
    100vh - var(--navbar_height) - var(--bottombar_height) - 65px
  ) !important;
  /* 50px is the height of the title w download button */
  padding-bottom: 5px;
  width: 100% !important;
  /* min-height: 600px; */
}

.confirm-button {
  margin-top: 20px;
  margin-bottom: 10px;
  width: 100%;
}

.fascia-filter {
  height: calc(100vh - var(--navbar_height) - var(--bottombar_height) - 280px);
  width: 100%;
}

.full-width {
  width: 100%;
}

.full-height {
  height: 100%;
}

/* Uploading data div styles */
.loadData-placeholder {
  font-size: 12px;
  width: 100%;
  height: 40px;
  line-height: 40px;
  border-width: 1px;
  border-style: dashed;
  border-radius: 5px;
  text-align: center;
}

.loadData-loaded {
  width: 100%;
  height: 40px;
  line-height: 40px;
  border-width: 1px;
  border-radius: 5px;
  text-align: center;
  background-color: var(--mantine-color-green-9);
  padding: 2px;
}

.loadData-loaded-text {
  color: white;
  max-width: calc(var(--sidebar_opened_width) - 70px);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  padding-left: 5px;
  text-overflow: ellipsis;
  text-align: center;
  display: block;
}

/* Styling for maps */
.info {
  position: absolute;
  top: 10px;
  text-align: left;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 5px 10px 5px 10px;
  box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2);
}

.table-close-btn {
  size: 20px;
  margin-top: 10px;
  margin-left: 15px;
  margin-bottom: 5px;
}

/* Logo styling */
.logo {
  font-size: 25px;
  font-weight: medium;
  font-family: "Alegreya Sans SC", sans-serif;
}

.dark-mode-fontcolor {
  color: #ffffff;
}

.light-mode-fontcolor {
  color: #000000;
}

/* Some component styling */
.dmc-bar {
  background-image: linear-gradient(to right, #adeee4, #00927e);
}

.curved-border {
  border-radius: 10px;
}

.curved-border-outline {
  border-radius: 10px;
  border: 2px solid var(--tab-border-color);
}

.user-item-hover {
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.user-item-hover:hover {
    background-color: var(--mantine-color-dark-5);
}

/* AG-Grid custom styles */
.clickable-grid .ag-row {
    cursor: pointer;
}
.ag-theme-quartz,
.ag-theme-quartz-dark {
  --ag-grid-size: 5px !important;
  --ag-list-item-height: 30px !important;
  --ag-font-size: 14px !important;
  --ag-font-family: 'Inter', sans-serif !important;
}

.ag-theme-quartz-dark {
  --ag-foreground-color: var(--mantine-color-text) !important;
  --ag-background-color: var(--mantine-color-dark-8) !important;
  --ag-header-foreground-color: var(--mantine-color-white) !important;
  --ag-header-background-color: var(--mantine-color-dark-9) !important;
  /* --ag-odd-row-background-color: var(--mantine-color-dark-9) !important; */
  /* --ag-header-column-resize-handle-color: #FFFFFF !important; */
  --ag-selected-row-background-color: var(--mantine-color-myPrimary) !important;
  --ag-selected-row-foreground-color: var(--mantine-color-white) !important;
  --ag-row-hover-color: var(--mantine-color-dark-5) !important;
}

.ag-theme-quartz .ag-cell,
.ag-theme-quartz-dark .ag-cell {
  font-size: 14px;
  /* Adjust the font size as needed */
}

.ag-theme-quartz .ag-header-cell-label,
.ag-theme-quartz-dark .ag-header-cell-label {
  font-size: 16px;
  /* Adjust the header font size as needed */
}

.ag-header-cell-filtered {
  background-color: #851b36 !important;
  /* color: #fff !important; */
}

.ag-header-cell-filtered span {
  color: #fff !important;
}

/* Bold styling with thicker border for selected columns (FasciaCol, SiteCol, LatCol, LonCol) */
.selected-column-header {
  font-weight: bold !important;
  border-bottom: 3px solid var(--mantine-color-gray-5) !important;
}

/* Red error icon for selected columns with validation errors */
.selected-column-header.has-errors .ag-header-cell-label::after,
.ag-header-cell.has-errors .ag-header-cell-label::after {
  content: "●" !important;
  color: #ff6b6b !important;
  font-size: 18px !important;
  margin-left: 4px !important;
  margin-right: 4px !important;
  position: relative !important;
  top: -6px !important;
  z-index: 10 !important;
  display: inline-block !important;
  vertical-align: top !important;
}

/* Cell styling classes for different validation states */
.ag-theme-quartz-dark .cell-missing-selected {
  border-left: 3px solid #e74c3c !important;
  background-color: rgba(231, 76, 60, 0.08) !important;
}

.ag-theme-quartz-dark .cell-invalid-selected {
  border-left: 3px solid #e74c3c !important;
  background-color: rgba(231, 76, 60, 0.08) !important;
  color: #ff8a80 !important;
}

.ag-theme-quartz-dark .special-column.cell-missing-selected,
.ag-theme-quartz-dark .special-column.cell-invalid-selected {
  border-left: none !important;
}

.ag-theme-quartz-dark .special-column.cell-missing-selected {
  background-color: rgba(231, 76, 60, 0.08) !important;
}

.ag-theme-quartz-dark .special-column.cell-invalid-selected {
  background-color: rgba(231, 76, 60, 0.08) !important;
  color: #ff8a80 !important;
}

.ag-theme-quartz-dark .cell-missing-regular {
  /* border-left: 2px solid #f39c12 !important; */
  background-color: rgba(243, 156, 18, 0.06) !important;
}

.ag-theme-quartz-dark .cell-disabled {
  background-color: var(--mantine-color-dark-7) !important;
  color: var(--mantine-color-text-dimmed) !important;
  opacity: 0.7 !important;
}

/* Light theme versions */
.ag-theme-quartz .cell-missing-selected {
  border-left: 3px solid #e74c3c !important;
  background-color: rgba(231, 76, 60, 0.06) !important;
}

.ag-theme-quartz .cell-invalid-selected {
  border-left: 3px solid #e74c3c !important;
  background-color: rgba(231, 76, 60, 0.06) !important;
  color: #c0392b !important;
}

.ag-theme-quartz .special-column.cell-missing-selected,
.ag-theme-quartz .special-column.cell-invalid-selected {
  border-left: none !important;
}

.ag-theme-quartz .special-column.cell-missing-selected {
  background-color: rgba(231, 76, 60, 0.06) !important;
}

.ag-theme-quartz .special-column.cell-invalid-selected {
  background-color: rgba(231, 76, 60, 0.06) !important;
  color: #c0392b !important;
}

.ag-theme-quartz .cell-missing-regular {
  /* border-left: 2px solid #e67e22 !important; */
  background-color: rgba(230, 126, 34, 0.04) !important;
}

.ag-theme-quartz .cell-disabled {
  background-color: #f8f9fa !important;
  color: #6c757d !important;
  opacity: 0.7 !important;
}

/* Duplicate values styling for selected SiteCol */
.ag-theme-quartz-dark .cell-duplicate-selected {
  border-left: 3px solid #e74c3c !important;
  background-color: rgba(231, 76, 60, 0.08) !important;
  color: #ff8a80 !important;
}

.ag-theme-quartz .cell-duplicate-selected {
  border-left: 3px solid #e74c3c !important;
  background-color: rgba(231, 76, 60, 0.06) !important;
  color: #c0392b !important;
}

/* Subtle background for special columns */
.special-column-header {
  background-color: var(--mantine-color-dark-8) !important;
}

/* For light theme special columns */
:root:not([data-mantine-color-scheme="dark"]) .special-column-header {
  background-color: #f8f9fa !important;
}

/* Map marker header icon using Font Awesome */
.map-marker-header-custom .ag-header-cell-text::before {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  content: "\f3c5" !important; /* Font Awesome location-dot */
  color: currentColor;
  font-size: 20px;
  display: inline-block;
  margin-left: 8px; /* Add left margin to align with cell content */
}

/* Align the map marker header to the left */
.map-marker-header-custom {
  text-align: left !important;
}

.map-marker-header-custom .ag-header-cell-label {
  justify-content: flex-start !important;
}

.map-marker-header-custom .ag-header-cell-text {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  width: 100% !important;
}

/* Align the map marker cell content to the left */
.map-marker-cell-custom {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding-left: 8px !important;
}

/* Some DCC component editing */
.markdown-text p {
  margin: 0;
  font-family: 'Inter', sans-serif;
}

/* Mapping CSS */
.circle {
  border-radius: 50%;
  /* make the div a circular shape */
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  -moz-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  -webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.marker-cluster div {
  color: black !important;
}

/* Full screen overlay */
.full-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background-color: var(--mantine-color-dark-9);
}

/* HTML: <div class="loader"></div> */
.loader {
  width: 120px;
  height: 60px;
  padding: 10px;
  box-sizing: border-box;
  position: relative;
  z-index: 10000;
}

.loader:before,
.loader:after {
  content: "";
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  mix-blend-mode: multiply;
}

.loader:before {
  background: #da4062;
  animation: moveRight 1.5s infinite alternate;
  left: 10px;
}

.loader:after {
  background: #55d6be;
  animation: moveLeft 1.5s infinite alternate;
  right: 10px;
}

@keyframes moveRight {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(30px);
  }
}

@keyframes moveLeft {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-30px);
  }
}
