/* Grundlayout */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Kartencontainer */
#map {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Ukraine-Banner */
#ukraine-banner {
  position: fixed;
  left: 2vw;
  bottom: 4vh; /* höher gesetzt */
  z-index: 1001;
  font-family: Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.16);
  pointer-events: none;
}

.ukraine-bar {
  min-width: 72px;
  padding: 3.5px 14px;
  text-align: center;
  font-size: 0.9em;
  font-weight: bold;
  letter-spacing: 2px;
  color: #222;
  border-radius: 6px;
}

.blue-bar {
  background: #0057b7;
  color: #fff;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.yellow-bar {
  background: #ffd700;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* --------------------------------------------- */
/* LOGO OVERLAY UNTEN RECHTS – CSS MASK */
/* --------------------------------------------- */
#logo-container {
  position: fixed;
  right: 2vw;
  bottom: 4vh;
  z-index: 1001;
  pointer-events: none;

  width: 170px;        /* Desktop-Größe */
  height: 60px;        /* Höhe anpassen falls nötig */

  background-color: #0057b7; /* Logo-Farbe */
  
  /* SVG als Maske */
  -webkit-mask: url('../img/trackfinder_logo.svg') no-repeat center / contain;
  mask: url('../img/trackfinder_logo.svg') no-repeat center / contain;

  opacity: 0.85;
  transition: opacity 0.2s ease;
}

/* Standardfarbe */
#logo-container {
  background-color: #0057b7;
}

/* Light-Mode Layer */
#logo-container.logo-light {
  background-color: #ffcc00;
}

/* Dark-Mode Layer */
#logo-container.logo-dark {
  background-color: #0057b7;
}

/* Satellit */
#logo-container.logo-sat {
  background-color: #ffffff;
}

#logo-container:hover {
  opacity: 1;
}

/* Tablets */
@media (max-width: 768px) {
  #logo-container {
    bottom: 6vh;
    width: 150px;
    height: 52px;
  }
}

/* Smartphones */
@media (max-width: 480px) {
  #logo-container {
    bottom: 6vh;
    width: 130px;
    height: 45px;
  }
}

/* --------------------------------------------- */
/* Autocomplete-Liste exakt so breit wie die Suchbox */
/* --------------------------------------------- */
.leaflet-searchbox-autocomplete {
    width: 100% !important;
    box-sizing: border-box;
    max-width: 100% !important;
    overflow-x: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.leaflet-searchbox-autocomplete-item.active {
    background: #0078ff;
    color: white;
}

.leaflet-searchbox-autocomplete-item .ds100 {
    font-size: 0.75em;
    font-style: italic;
    color: #555;
}

/* Popup */
.leaflet-popup-content-wrapper {
    min-width: 220px;
    padding: 10px 10px !important;
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
}

.popup-container {
    font-family: Arial, sans-serif;
}

.popup-title {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4px;
}

.popup-table {
    margin: 0;
    padding: 0;
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}

.popup-table td {
    padding: 2px 10px 2px 0;
    vertical-align: top;
}

.popup-table td:last-child {
    padding-right: 0;
}

.popup-subtable {
    border-collapse: collapse;
}

.popup-subtable td {
    padding: 0 4px 0 0;
}

.popup-subtable td:first-child {
    padding-right: 12px;
}

/* Untere Trennlinie */
.popup-separator {
    margin: 10px 0 8px 0;
    border-bottom: 1px solid #ccc;
}

/* Navigation-Icon */
.popup-nav-icons {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

/* Navigation */
.popup-nav-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    background-image: url('../img/gps1.jpg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.15s ease;
}
.popup-nav-icon:hover {
    transform: scale(1.1);
}

/* Lageplan farbig */
.popup-plan-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
}

/* farbig */
.popup-plan-icon:not(.disabled) {
    background-image: url('../img/lageplan_c.png');
    cursor: pointer;
    transition: transform 0.15s ease;
}
.popup-plan-icon:not(.disabled):hover {
    transform: scale(1.1);
}

/* schwarzweiß */
.popup-plan-icon.disabled {
    background-image: url('../img/lageplan_b.png');
    opacity: 0.6;
    cursor: default;
}

/* Abfahrtsplan farbig */
.popup-timetable-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
}

/* farbig */
.popup-timetable-icon:not(.disabled) {
    background-image: url('../img/db_clock_c.png');
    cursor: pointer;
    transition: transform 0.15s ease;
}
.popup-timetable-icon:not(.disabled):hover {
    transform: scale(1.1);
}

/* schwarzweiß */
.popup-timetable-icon.disabled {
    background-image: url('../img/db_clock_b.png');
    opacity: 0.6;
    cursor: default;
}

/* Notyf Message */
.notyf__message {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* --------------------------------------------- */
/* Präzisions-Indikator für interpolierte Streckenkilometer*/
/* --------------------------------------------- */
.precision-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;

    /* Positionierung */
    float: right;
    margin-right: 4px;   /* minimal nach links */
    position: relative;
    top: 2px;            /* minimal nach unten */
}
/* Farben */
.precision-high {
    background-color: #33cc33; /* grün */
}
.precision-good {
    background-color: #ffcc00; /* gelb */
}
.precision-medium {
    background-color: #ff9900; /* orange */
}
.precision-low {
    background-color: #ff3333; /* rot */
}
.precision-none {
    background-color: #cccccc; /* grau */
}
/* Tooltip */
.precision-indicator:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -28px;
    right: -10px;
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 9999;
    opacity: 0.9;
}

/* Streckenname in Popup */
.streckenname {
    margin: 6px 0 10px 0;
    font-size: 0.95em;
    color: #444;
}

/* Lade-Spinner */
.leaflet-loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    z-index: 99999; /* höher als Leaflet-Controls */
    pointer-events: none;
}
.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 6px auto;
	will-change: transform;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#clock {
  position: absolute;
  top: 5px;
  left: 50px;
  width: 120px;   /* optional kleinere Anzeige */
  height: 120px;
  z-index: 9999;
  pointer-events: none; /* damit die Karte darunter klickbar bleibt */
}
/* Auf Smartphones ausblenden */
@media (max-width: 767px) {
  #clock {
    display: none;
  }
}
