body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: #1a1a1a;
}

#map {
  background-color: #000000;
}


/* Loading Screen */
.loader-wrapper {
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  place-items: center; 
  display: grid;
}

.loader-wrapper.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-out;
}


.loader, .loader:before, .loader:after {
  border-radius: 50%;
  width: 2.5em;
  height: 2.5em;
  animation-fill-mode: both;
  animation: bblFadInOut 1.8s infinite ease-in-out;
}
.loader {

  color: #FFF;
  font-size: 7px;
  position: relative;
  text-indent: -9999em;
  transform: translateZ(0);
  animation-delay: -0.16s;

}
.loader:before,
.loader:after {
  content: '';
  position: absolute;
  top: 0;
}
.loader:before {
  left: -3.5em;
  animation-delay: -0.32s;
}
.loader:after {
  left: 3.5em;
}

@keyframes bblFadInOut {
  0%, 80%, 100% { box-shadow: 0 2.5em 0 -1.3em }
  40% { box-shadow: 0 2.5em 0 0 }
}
    
/* filter img */
.filter-icon {
  width: 23px;
  height: 22px;
  align-self: center;
  margin-top: 3px;
  /* filter: invert(1); */
}



/* tutorial style */
.tutorial {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 9997;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial.hidden {
  display: none;
}

.tutorial-content {
  background: #1a1a1c;
  border-radius: 10px;
  padding: 20px;
  width: 300px;
  position: relative;
  color: #f1f1f1;
  text-align: center;
}

.tutorial-content h3 {
  margin: 0 0 16px;
  font-size: 18px;
}

.tutorial-tips{
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  color: #cfcfd1;
}

.tutorial-close{
  width: 100%;
  padding: 10px;
  background: #00bf19;
  border: none;
  border-radius: 6px;
  color: #000;
  font-weight: 600;
  cursor: pointer;

}

/* Map */

.maplibregl-popup-content {
  background: rgb(82, 81, 81);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  font-family: -apple-system, system-ui, sans-serif;
  min-width: 240px;
  animation: popupFadeIn 0.3s ease-out;
}

.maplibregl-popup{
  transition: scale 0.3s ease-out;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}






/* .maplibregl-popup-close-button {
  font-size: 18px;
  color: #888;
  padding: 4px 8px;
} */

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.popup-name {
  font-weight: 600;
  font-size: 16px;
  margin: 0;
}

.popup-location {
  font-size: 13px;
  color: #ffffff;
  margin: 2px 0 0;
}

.popup-position-badge {
  background: #E6F1FB;
  color: #0C447C;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 8px;
}

/* Position Color Badge */
/* #theme-blue:checked ~ .app-container { --main-color: #3498db; }
#theme-green:checked ~ .app-container { --main-color: #2ecc71; }
#theme-purple:checked ~ .app-container { --main-color: #9b59b6; } */

.popup-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.popup-stat-box {
  background: #F5F5F5;
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
}

.popup-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: #000000;
  margin: 0;
}

.popup-stat-value {
  font-size: 15px;
  font-weight: 600;
  margin: 2px 0 0;
  color: #000000;
}

.popup-footer {
  border-top: 1px solid #eee;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #777;
}

/*     Cluster side Panel       */

.player-panel {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 320px;
  background-color: rgba(0, 0, 0, 0.4);
  color: #f1f1f1;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4);
  transform: translateX(-100%);
  transition: transform 0.25s ease-out;
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.player-panel.open {
  transform: translateX(0);
}

.player-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  border-bottom: 1px solid #333;
  background-color: rgba(0, 0, 0, 0.4) /* explicitly transparent — just a header container */
}

.player-panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.player-panel-header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #999;
}

.player-panel-close {
  background: none;
  border: none;
  color: #999;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.player-panel-close:hover {
  color: #fff;
}

.player-panel-list {
  list-style: none;
  margin: 0;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  background-color: transparent; /* explicitly transparent — just a scroll container */

  scrollbar-width: thin;
  scrollbar-color: #ffffff transparent;
}

.player-panel-list li {
  padding: 12px 16px;
  border-bottom: 1px solid #2a2a2c;
  cursor: pointer;
  transition: background 0.15s;
}

.player-panel-list li:hover {
  background: #2a2a2c;
}

.player-panel-list .player-name {
  font-weight: 600;
  font-size: 14px;
}

.player-panel-list .player-meta {
  font-size: 12px;
  color: #000000;
  margin-top: 2px;
}

/* Panel Player Style */
.player-panel-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  flex: 1;

  scrollbar-width: thin;
  scrollbar-color: #444 transparent;

}

.player-panel-list::-webkit-scrollbar {
  width: 6px;
}

.player-panel-list::-webkit-scrollbar-track {
  background: transparent;
}

.player-panel-list::-webkit-scrollbar-thumb {
  background-color: #444;
  border-radius: 10px;
}

.player-panel-list::-webkit-scrollbar-thumb:hover {
  background-color: #5a5a5a;
}


/* Style for Singel Player Detail */
.panel-detail-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.popup-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8a8a8d;
  margin: 0;
}

.popup-bio-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popup-bio-block p {
  margin: 0;
  font-size: 13px;
  color: #cfcfd1;
}

.report-player-btn {
  margin-top: 8px;
  padding: 10px;
  background: transparent;
  border: 1px solid #444;
  border-radius: 8px;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.report-player-btn:hover {
  background: #2a1414;
  border-color: #803333;
  color: #ff6b6b;
}



.panel-player-card {
  background: #242426;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
  cursor: default;
  opacity: 0;
  transform: translateX(-40px);
  animation: cardSlideIn 0.3s ease-out forwards;
}

.panel-player-card:last-child {
  margin-bottom: 0;
}

@keyframes cardSlideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Search Bar CSS */
.search-container {
  /* position: absolute; */
  top: 16px;
  right: 55px;
  z-index: 20;
  width: 280px;
}

#player-search {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #333;
  background: rgba(0, 0, 0, 0.7);
  color: #f1f1f1;
  font-size: 14px;
}

.search-suggestions {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  background: #1a1a1c;
  border-radius: 8px;
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.search-suggestions.hidden {
  display: none;
}

.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  color: #f1f1f1;
  font-size: 14px;
}

.search-result-item:hover {
  background: #2a2a2c;
}

.search-result-meta {
  color: #888;
  font-size: 12px;
}

.search-no-results {
  padding: 10px 14px;
  color: #888;
  font-size: 13px;
}

/* Filter Buttons Styles */
.top-bar {
  position: absolute;
  top: 16px;
  right: 50px; 
  z-index: 20;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.filter-container {
  position: relative;


}

.filter-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #333;
  background: rgba(0, 0, 0, 0.7);
  color: #f1f1f1;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 2;
}

.filter-panel {
  position: absolute;
  right: 90px;
  top: -5px;

  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  background: #1a1a1c;
  border-radius: 8px;
  margin-left: -1px;
  padding: 0;

  opacity: 0;
  transform: translateX(20px);

  transition: all 0.45s ease;
}

.filter-panel.open {
  opacity: 1;
  max-width: 795px; /* big enough to fit all groups */
  padding: 10px 16px;
  pointer-events: auto;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.filter-group-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8a8a8d;
  margin: 0;
}

.filter-btn-row {
  display: flex;
  gap: 6px;
}

.filter-option {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #333;
  background: transparent;
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
}

.filter-option.active {
  background: #00bf19;
  border-color: #00bf19;
  color: #000;
}

.filter-era-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-era-inputs input {
  width: 70px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #0d0d0e;
  color: #f1f1f1;
  font-size: 13px;
}

.filter-clear-btn {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #444;
  background: transparent;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}

.filter-clear-btn:hover {
  border-color: #803333;
  color: #ff6b6b;
}




/* Report Player Style */

.report-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-modal.hidden {
  display: none;
}

.report-modal-content {
  background: #1a1a1c;
  border-radius: 10px;
  padding: 20px;
  width: 300px;
  position: relative;
  color: #f1f1f1;
}

.report-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none; border: none;
  color: #999; font-size: 20px;
  cursor: pointer;
}

.report-modal-subtitle {
  color: #999;
  font-size: 13px;
  margin: 0 0 16px;
}

#report-reason {
  width: 100%;
  padding: 8px;
  margin-top: 6px;
  margin-bottom: 16px;
  background: #0d0d0e;
  color: #f1f1f1;
  border: 1px solid #333;
  border-radius: 6px;
}

.report-submit-btn {
  width: 100%;
  padding: 10px;
  background: #00bf19;
  border: none;
  border-radius: 6px;
  color: #000;
  font-weight: 600;
  cursor: pointer;
}

.report-submit-btn:disabled {
  background: #333;
  color: #777;
  cursor: not-allowed;
}

.report-status-msg {
  font-size: 12px;
  margin-top: 10px;
  text-align: center;
}

/*  */

.mobile-warning {
  display: none;
}

/* Macbook */
@media (max-width: 1512px) {
  .top-bar {
    right: 35px;
    gap: 17px;
  }
  .filter-container {
    right: -10px;
  }
  .filter-panel {
    right: 70px;
  }
  .search-container {
    right: 30px;
    width: 240px;
  }
}

/* Phones Media Queries */
@media (max-width: 768px) {
  .mobile-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9998;
    background: #1a1a1c;
    color: #f1f1f1;
    padding: 10px 14px;
    font-size: 13px;
    box-sizing: border-box;
    border-bottom: 1px solid #333;
  }

  .mobile-warning.hidden {
    display: none;
  }

  .mobile-warning-close {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
  }
}

@media (max-width: 768px) {

  .top-bar {
    flex-direction: column;
    align-items: flex-end;
    flex-direction: column-reverse;
  }


  .filter-container {
    align-self: flex-end;
    right: -25px;
  }
  .filter-panel {
    /* reset the desktop side-slide positioning for mobile */
    right: 0;
    top: calc(100% + 8px);
    max-width: 0;
    max-height: 0;
    width: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    transform: none;
    overflow: hidden;
    transition: max-width 0.35s ease, max-height 0.35s ease, padding 0.35s ease;
    right: -10px;
    gap: 8px;
  }

  .filter-panel.open {
    max-height: 70vh;
    width: 90vw;
    padding: 16px;
    overflow-y: auto;

    max-width: 30vw;
    padding: 8px 10px;
  }

  .filter-group {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .filter-btn-row {
    flex-wrap: wrap;
  }

  .filter-era-inputs input {
    width: 80px;
  }
 .filter-toggle-btn {
    width: 32px;
    height: 32px;
  }

  .filter-icon {
    width: 18px;
    height: 18px;
    display: block;
  }

  .filter-group {
    gap: 4px;
  }

  .filter-group-label {
    font-size: 10px;
  }

  .filter-btn-row {
    gap: 4px;
  }

  .filter-option {
    padding: 4px 7px;
    font-size: 11px;
  }

  .filter-era-inputs input {
    width: 45px;
    padding: 4px 6px;
    font-size: 11px;
  }

  .filter-clear-btn {
    padding: 6px 8px;
    font-size: 11px;
  }

  .player-panel {
    height: 80%;
    top: 10%;
  }

}

/* @media (max-width: 480px) {
  .filter-icon {
   margin-left: -9px;
  }
} */

@media (max-width: 932px) and (orientation: landscape) {

  .filter-container {
    
  }
  .filter-panel {
    right: 60px;
    width: 540px;
  }

  .filter-group {
    flex-direction: column;
  }

}