* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #0a0f1c;
  color: #d7e3ff;
  font-family: "Orbitron", sans-serif;
}

/* Header */

header{
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-top: 25px;
    margin-bottom: 25px;
}

.topbar {
    height: 80px;
}

.types-dropdown {
    position: relative;
    z-index: 3000;
}

.types-dropdown .dropdown-menu {
    position: absolute;
    z-index: 4000;
}

.title {
    margin: 0;
}

.form-label.fw-bold{
  text-align: center;
}

.filters {
    display: flex;
    gap: 5rem;
    align-items: flex-end;
    flex: 1;
    justify-content: center; /* centre les filtres */
}

.actions {
    display: flex;
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

/* MAIN */
main {
    flex: 1;
    display: flex;
    padding: 15px;
}

/* MAP */
#map {
  height: auto;
  width: 100%;
  flex: 1 1 0%;
  position: relative;
  border: 2px solid #00eaff;
  box-shadow: 0 0 20px #00eaff, inset 0 0 20px #007a99;
  border-radius: 12px;
}

.ota-stats-box {
    background: rgba(10, 20, 40, 0.85);
    border: 1px solid #00eaff;
    padding: 8px 14px;
    border-radius: 6px;
    color: #00eaff;
    font-family: "Orbitron", sans-serif;
    font-size: 0.9rem;
    box-shadow: 0 0 12px #00eaff;
    backdrop-filter: blur(4px);
}


/* Footer */
.bottombar {
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 16px;
  background: rgba(10, 20, 40, 0.8);
  border-top: 2px solid #00eaff;
  backdrop-filter: blur(6px);
}

.bottombar #status {
  background: transparent;
  color: #00eaff;
  border: 1px solid #00eaff;
  box-shadow: 0 0 10px #00eaff;
}


.bottombar h1 {
  font-size: 1.4rem;
  margin: 0;
}

.legend {
  display: flex;
  align-items: center;
  gap: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
}

p{
  margin: 0;
  margin-bottom: 0px;
}

legend-item.name {
  font-weight: bold;
  margin : 0px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

/* Couleurs marqueurs Leaflet */
.dot.red {
  background: #ff4d4d;
}

.dot.green {
  background: #4dff4d;
}

.dot.yellow {
  background: #ffe44d;
}

.dot.cyan {
  background: #4ddaff;
}

.btn-primary {
    background: transparent;
    border: 1px solid #00eaff;
    color: #00eaff;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: 0.15s ease-out;
}

.btn-primary:hover {
    background: rgba(0, 234, 255, 0.15);
    border-color: #00eaff;
    color: #00eaff;
    transform: translateY(-1px);
}

select, .form-select {
    background: rgba(5, 10, 20, 0.9);
    border: 1px solid #00eaff;
    color: #d7e3ff;
    box-shadow: 0 0 10px #00eaff;
}

.select-btn,
.form-select.select-btn {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  width: auto;
  min-width: 170px;
  max-width: 100%;
  box-sizing: border-box;
  padding: .375rem 2.1rem .375rem .75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #fff;
  background-color: #6c757d; /* bootstrap secondary */
  border: 1px solid #6c757d;
  border-radius: .375rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 5'%3E%3Cpath fill='%23ffffff' d='M0 0l4 5 4-5Z'/%3E%3C/svg%3E");
  background-position: right 1rem center;
  background-size: .75rem .5rem;
  background-repeat: no-repeat;
  cursor: pointer;
}

.select-btn::-ms-expand,
.form-select.select-btn::-ms-expand {
  display: none;
}

.form-select.select-btn option {
  color: #000;
}

.form-select.select-btn:focus {
  outline: none;
  box-shadow: 0 0 0 .25rem rgba(108,117,125,.25);
  border-color: #5a6268;
}

/* Types dropdown fixes: ensure it displays above content and is not clipped */
.dropdown-menu {
    background: rgba(5, 10, 20, 0.9);
    border: 1px solid #00eaff;
    box-shadow: 0 0 15px #00eaff;
}

.controls {
  position: relative;
  overflow: visible; /* allow dropdowns to extend */
}

.types-dropdown {
  position: relative;
}

.types-dropdown .dropdown-toggle {
  width: 100%;
  text-align: left;
  justify-content: space-between;
}

.types-dropdown .dropdown-menu {
  position: absolute !important;
  left: 0;
  top: calc(100% + 6px);
  z-index: 2050; /* above map controls */
  width: calc(100% - 0px);
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-radius: 8px;
  padding: 12px;
}

.types-dropdown .dropdown-menu .form-check {
  margin-bottom: 0.6rem;
}

.types-dropdown .dropdown-menu .form-check-label {
  color: #111827;
}

/* Ensure dropdown buttons don't inherit unwanted colors */
.types-dropdown .btn {
  background: #6c757d;
  color: #fff;
  border-color: #6c757d;
}

/* Small screens: dropdown full width */
@media (max-width: 480px) {
  .types-dropdown .dropdown-menu { left: 0; right: 0; width: auto; }
}

/* Legend control styling */
.legend-control {
  background: white;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
}

.legend-box {
  margin: 0;
}

.legend-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 8px 0;
  color: #111827;
}

.legend-section-title {
  margin: 10px 0 6px 0;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.legend-section-spacing {
  margin-top: 12px;
}

.legend-control .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: #111827;
}

.legend-control .legend-item:last-child {
  margin-bottom: 0;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.types-dropdown .dropdown-toggle {
  width: 100%;
  text-align: left;
  justify-content: space-between;
}

.types-dropdown .dropdown-menu {
  width: 100%;
  min-width: 230px;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.75rem;
}

.types-dropdown .dropdown-menu .form-check {
  margin-bottom: 0.75rem;
}

.types-dropdown .dropdown-menu .form-check-label {
  color: #111827;
}

.ota-marker-icon {
  background: transparent !important;
  border: none !important;
}

.ota-marker-icon svg {
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.ota-popup-source {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ota-popup-activation {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ota-source-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ota-source-unknown {
  background: #64748b;
}

.ota-activation-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.ota-activation-badge-active {
  background: #22c55e;
}

.ota-activation-badge-inactive {
  background: #ef4444;
}

.ota-activation-badge-unknown {
  background: #64748b;
}

/* Regroupement des marqueurs (clusters) */
.ota-cluster {
  background: transparent;
  border: none;
}

.ota-cluster div {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.85);
  border: 2px solid #ffffff;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.ota-cluster-small div {
  background: rgba(14, 165, 233, 0.85);
  font-size: 0.75rem;
}

.ota-cluster-medium div {
  background: rgba(59, 130, 246, 0.9);
  font-size: 0.95rem;
}

.ota-cluster-large div {
  background: rgba(255, 0, 0, 0.95);
  font-size: 1rem;
}