/* styles.css - Complete styling for Interactive Frontier Map */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  background: #111;
  font-family: 'Roboto', sans-serif;
}

#map {
  width: 100%;
  height: 100%;
}

.leaflet-tile {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Panel Styles */
#panel {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1000;

  background: rgba(15, 17, 23, 0.95);
  border: 1px solid #2a2f3f;
  border-radius: 10px;

  width: 280px;
  color: #e2e8f0;
  font-size: 12px;

  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);

  max-height: calc(100vh - 20px);

  display: flex;
  flex-direction: column;

  transition: width 0.2s, height 0.2s, border-radius 0.2s;
}

#panel-header {
  position: relative;
  padding: 12px 14px 10px;
  border-bottom: 1px solid #2a2f3f;
  flex-shrink: 0;
}


#panel-header h2 {
  font-size: 13px;
  font-weight: 700;
  color: #4f8ef7;
  margin-bottom: 8px;
}


#layer-search {
  width: 100%;
  background: #0f1117;
  border: 1px solid #2a2f3f;
  color: #e2e8f0;
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
}

#layer-search:focus {
  border-color: #4f8ef7;
}

#panel-body {
  overflow-y: auto;
  flex: 1;
  padding: 10px 14px;
}

#panel-body::-webkit-scrollbar {
  width: 4px;
}

#panel-body::-webkit-scrollbar-thumb {
  background: #2a2f3f;
  border-radius: 2px;
}

/* Section Titles */
.section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin: 10px 0 6px;
  font-weight: 600;
}

/* Layer Items */
.layer-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s;
}

.layer-item:hover {
  background: #1e2333;
}

.layer-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.layer-label {
  flex: 1;
  color: #cbd5e1;
}

.layer-count {
  color: #475569;
  font-size: 10px;
}

.layer-check {
  width: 14px;
  height: 14px;
  accent-color: #4f8ef7;
  cursor: pointer;
}

/* Coordinates Display */
#coords {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 17, 23, 0.85);
  color: #64748b;
  font: 11px monospace;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid #2a2f3f;
  pointer-events: none;
  z-index: 999;
}


@media (max-width: 768px) {

    #panel {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;

        width: 100%;
        height: 300px;
        max-height: 300;

        border-radius: 10px 10px 0 0;
        border-left: none;
        border-right: none;

        z-index: 1000;
    }

    #panel-header {
        padding: 10px 14px;
    }

    #panel-body {
        flex: 1;
        overflow-y: auto;
        padding: 8px 14px;
    }

}
#panel-toggle {
  position: absolute;
  top: 8px;
  right: 8px;

  width: 24px;
  height: 24px;

  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #1e2333;
  color: #e2e8f0;

  border: 1px solid #2a2f3f;
  border-radius: 50%;

  cursor: pointer;
  font-size: 18px;
  line-height: 1;

  z-index: 2;
}


#panel-toggle:hover {
  background: #4f8ef7;
}


/* Panel body */
#panel-body {
  overflow-y: auto;
  flex: 1;
  padding: 10px 14px;
}


/* Collapsed state */
#panel.collapsed {
    background: transparent;
    border: none;
    box-shadow: none;

    width: 45px;
    height: 45px;

    overflow: visible;
}


/* Hide panel contents */
#panel.collapsed #panel-header h2,
#panel.collapsed #layer-search,
#panel.collapsed #panel-body {
    display: none;
}


/* Keep only the button */
#panel.collapsed #panel-header {
    border: none;
    padding: 0;
    height: 45px;
}


/* Center button */
#panel.collapsed #panel-toggle {
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%);
}

/* Mobile */
@media (max-width: 768px) {

  #panel {

    top: auto;
    left: 0;
    right: 0;
    bottom: 0;

    width: 100%;
    height: 200px;
    max-height: 200px;

    border-radius: 10px 10px 0 0;
  }


  #panel-header {
    padding: 10px 14px;
  }


  #panel-body {

    flex: 1;
    overflow-y: auto;
    padding: 8px 14px;
  }


  /* Mobile collapsed circle */
  #panel.collapsed {

    width: 45px;
    height: 45px;

    left: auto;
    right: 10px;
    bottom: 10px;

    border-radius: 50%;
  }


  #panel-toggle {

    top: 8px;
    right: 8px;
  }


  #panel.collapsed #panel-toggle {

    top: 50%;
    right: 50%;

    transform: translate(50%, -50%);
  }

}