
/*NEU*/

/* Haupt-Container */
.runners {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.runners .header {
    background: linear-gradient(135deg, #1e5799 0%, #207cca 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.runners .header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.runners .header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

/* Live-Indicator */
.runners .live-indicator {
    display: inline-flex;
    align-items: center;
    color: #ff5252;
    font-weight: 600;
    animation: pulsez 1.5s infinite;
}

@keyframes pulsez {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.runners .live-dot {
    width: 10px;
    height: 10px;
    background-color: #ff5252;
    border-radius: 50%;
    margin-right: 0.5rem;
}

/* Hauptinhalt */
.runners .main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Karten-Container */
.runners .map-container {
    flex: 3;
    position: relative;
    min-height: 400px;
}

.runners #map {
    height: 100%;
    width: 100%;
    z-index: 1;
}

/* Karten-Steuerungen */
.runners .map-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.runners .control-btn {
    background-color: white;
    border: none;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #1e5799;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.runners .control-btn:hover {
    background-color: #f0f5ff;
    transform: scale(1.05);
}

/* Route Controls - Select Box Container */
.runners .route-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    max-width: 200px; /* Begrenzung der Breite */
}

/* Select Box Styling */
.runners .route-controls select {
    padding: 0.6rem 2rem 0.6rem 1rem;
    font-size: 0.95rem;
    border: 2px solid white;
    border-radius: 4px;
    background-color: white;
    color: #1e5799;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231e5799' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1rem;
    width: 100%;
    min-width: 150px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Select Box Optionen Styling */
.runners .route-controls select option {
    padding: 8px;
    font-size: 0.95rem;
    background-color: white;
    color: #1e5799;
    white-space: normal; /* Erlaubt Zeilenumbruch */
    word-wrap: break-word;
    min-width: 100%;
}

/* Für Firefox spezifisch */
.runners .route-controls select option {
    background-color: white;
    color: #1e5799;
}

/* Für Chrome/Safari */
.runners .route-controls select optgroup,
.runners .route-controls select option {
    background-color: white;
    color: #1e5799;
}

/* Sidebar Panel */
.runners .tracker-panel {
    flex: 1;
    background-color: white;
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.08);
    min-width: 350px;
    min-height: 600px;
}

.runners .tracker-title {
    font-size: 1.5rem;
    color: #1e5799;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
}

/* Suchbox */
.runners .search-box {
    display: flex;
    margin-bottom: 1.5rem;
    width: 100%;
}

.runners #runnerNumber {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 2px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
    -webkit-appearance: none;
    appearance: none;
    height: 42px; /* Feste Höhe */
    box-sizing: border-box;
}

.runners #runnerNumber:focus {
    border-color: #1e5799;
}

.runners #trackRunner {
    background-color: #1e5799;
    color: white;
    border: none;
    padding: 0 1.2rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background-color 0.3s;
    -webkit-tap-highlight-color: transparent;
    height: 42px; /* Gleiche Höhe wie Input */
    box-sizing: border-box;
    white-space: nowrap;
    min-width: 100px; /* Minimale Breite */
}

.runners #trackRunner:hover {
    background-color: #16437e;
}

/* Läufer-Info Box */
.runners .runner-info {
    background-color: #f9fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.runners .runner-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.runners .runner-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e5799 0%, #207cca 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    margin-right: 1rem;
}

.runners .runner-details h3 {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
    color: #1e5799;
}

.runners .runner-details p {
    color: #666;
    font-size: 0.95rem;
}

/* Statistiken */
.runners .stats {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.runners .stat-item {
    text-align: center;
    flex: 1;
}

.runners .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e5799;
}

.runners .stat-label {
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.3rem;
}

/* Verfolgte Läufer Liste */
.runners .tracked-runners {
    margin-top: 2rem;
}

.runners .tracked-title {
    font-size: 1.2rem;
    color: #1e5799;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.runners .tracked-list {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.runners .tracked-list li {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #f9fafc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid #1e5799;
    -webkit-tap-highlight-color: transparent;
}

.runners .tracked-list li:hover {
    background-color: #edf2f7;
    transform: translateX(4px);
}

.runners .tracked-list li.active {
    background-color: #e1eaf5;
    border-left-color: #ff9800;
}

.runners .tracked-number {
    font-weight: bold;
    color: #1e5799;
    margin-right: 0.75rem;
    font-size: 1rem;
}

.runners .tracked-name {
    flex: 1;
    font-size: 0.95rem;
}

.runners .tracked-remove {
    color: #ff5252;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem 0.4rem;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

/* Footer */
.runners .footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

/* Zusätzliche Stile für WordPress-Einbettung */
.runners .container {
    padding: 0 15px;
}

/* Leaflet Marker Anpassungen */
.runners .leaflet-marker-icon {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* ===== VERBESSERTE MOBILE ANPASSUNGEN ===== */

/* Tablet-Landscape und kleinere Desktops */
@media (max-width: 1024px) {
    .runners .main-content {
        flex-direction: column;
    }

    .runners .map-container {
        height: 60vh;
        min-height: 400px;
    }

    .runners .tracker-panel {
        min-width: 100%;
        max-height: 50vh;
        overflow-y: auto;
    }

    /* Select Box für Tablet optimieren */
    .runners .route-controls select {
        padding: 0.5rem 1.8rem 0.5rem 0.8rem;
        font-size: 0.9rem;
        max-width: 180px;
    }
}

/* Mobile Portrait und Landscape Fixes */
@media (max-width: 580px) {
    .runners {
        height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding-top:20px;
    }

    .runners .header {
        padding: 1rem;
    }

    .runners .header h1 {
        font-size: 1.5rem;
    }

    .runners .header p {
        font-size: 0.9rem;
    }

    .runners .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        height: calc(100vh - 56px);
        gap:20px;
    }

    .runners .map-container {
        flex: 1 1 50%;
        min-height: 0;
        height: auto;
        position: relative;
        width: 100%;
    }

    .runners #map {
        position: absolute !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
    }

    .runners .tracker-panel {
        flex: 1 1 50%;
        min-height: 0;
        overflow-y: auto;
        padding: 1rem;
        background: white;
    }

    .leaflet-container {
        width: 100% !important;
        height: 100% !important;
    }

    /* Map Controls */
    .runners .map-controls {
        top: 0.75rem;
        left: 0.75rem;
        gap: 0.4rem;
    }

    .runners .control-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* Route Controls - Mobile Optimierung */
    .runners .route-controls {
        bottom: 0.75rem;
        right: 0.75rem;
        max-width: 160px;
    }

    .runners .route-controls select {
        padding: 0.4rem 1.6rem 0.4rem 0.6rem;
        font-size: 0.85rem;
        border-width: 1px;
        min-width: 120px;
        max-width: 160px;
        background-size: 0.9rem;
        background-position: right 0.4rem center;
    }

    /* Optionen Dropdown für Mobile */
    .runners .route-controls select option {
        font-size: 0.85rem;
        padding: 6px;
        max-width: 100%;
    }

    /* Suchbox Mobile */
    .runners .search-box {
        margin-bottom: 1rem;
    }

    .runners #runnerNumber {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
        height: 38px;
    }

    .runners #trackRunner {
        padding: 0 1rem;
        font-size: 0.9rem;
        height: 38px;
        min-width: 80px;
    }

    /* Runner Info */
    .runners .runner-info {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .runners .runner-avatar {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        margin-right: 0.75rem;
    }

    .runners .runner-details h3 {
        font-size: 1rem;
    }

    .runners .runner-details p {
        font-size: 0.85rem;
    }

    /* Stats Mobile */
    .runners .stats {
        margin-top: 0.75rem;
        gap: 0.25rem;
    }

    .runners .stat-item {
        padding: 0.15rem;
    }

    .runners .stat-value {
        font-size: 1.1rem;
    }

    .runners .stat-label {
        font-size: 0.7rem;
    }

    /* Tracked List */
    .runners .tracked-runners {
        margin-top: 1.5rem;
    }

    .runners .tracked-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .runners .tracked-list li {
        padding: 0.6rem;
        margin-bottom: 0.4rem;
    }

    .runners .tracked-number {
        font-size: 0.9rem;
        margin-right: 0.5rem;
    }

    .runners .tracked-name {
        font-size: 0.85rem;
    }

    .runners .tracked-remove {
        font-size: 1rem;
        padding: 0.1rem 0.3rem;
    }
}

/* Kleine Smartphones */
@media (max-width: 480px) {
    .runners .map-container {
        flex: 1 1 45%;
    }

    .runners .tracker-panel {
        flex: 1 1 55%;
        padding: 0.75rem;
    }

    /* Noch kompaktere Select Box */
    .runners .route-controls {
        max-width: 140px;
    }

    .runners .route-controls select {
        padding: 0.35rem 1.4rem 0.35rem 0.5rem;
        font-size: 0.8rem;
        min-width: 100px;
        max-width: 140px;
        background-size: 0.8rem;
    }

    .runners .route-controls select option {
        font-size: 0.8rem;
    }

    /* Kompakte Suchbox */
    .runners #runnerNumber {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        height: 36px;
    }

    .runners #trackRunner {
        padding: 0 0.8rem;
        font-size: 0.85rem;
        height: 36px;
        min-width: 70px;
    }

    /* Kompakte Statistiken */
    .runners .stat-value {
        font-size: 1rem;
    }

    .runners .tracker-title {
        font-size: 1.1rem;
    }
}

/* Sehr kleine Smartphones */
@media (max-width: 360px) {
    .runners .search-box {
        flex-direction: column;
    }

    .runners #runnerNumber {
        border-radius: 4px;
        margin-bottom: 0.4rem;
        width: 100%;
        height: 40px;
    }

    .runners #trackRunner {
        border-radius: 4px;
        padding: 0.6rem;
        width: 100%;
        height: 40px;
    }

    .runners .stats {
        flex-direction: column;
        gap: 0.4rem;
    }

    .runners .stat-item {
        width: 100%;
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.25rem 0;
    }

    .runners .stat-label {
        margin-top: 0;
    }

    /* Select Box für sehr kleine Screens */
    .runners .route-controls {
        max-width: 120px;
    }

    .runners .route-controls select {
        padding: 0.3rem 1.2rem 0.3rem 0.4rem;
        font-size: 0.75rem;
        min-width: 90px;
        max-width: 120px;
    }

    .runners .route-controls select option {
        font-size: 0.75rem;
    }

    /* Kompaktere Tracked List */
    .runners .tracked-list li {
        padding: 0.4rem;
    }

    .runners .tracked-number {
        font-size: 0.85rem;
    }

    .runners .tracked-name {
        font-size: 0.8rem;
    }
}

/* Landscape-Modus auf Smartphones */
@media (max-width: 896px) and (orientation: landscape) {
    .runners .main-content {
        flex-direction: row;
    }

    .runners .map-container {
        flex: 1 1 60%;
    }

    .runners .tracker-panel {
        flex: 1 1 40%;
        padding: 0.75rem;
    }

    .runners .tracker-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.3rem;
    }

    .runners .runner-info {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .runners .search-box {
        margin-bottom: 0.5rem;
    }

    .runners #runnerNumber,
    .runners #trackRunner {
        height: 34px;
        font-size: 0.8rem;
    }

    .runners .route-controls select {
        padding: 0.3rem 1.4rem 0.3rem 0.5rem;
        font-size: 0.8rem;
    }

    .runners .stats {
        margin-top: 0.3rem;
    }
}

/* Safe Area Insets */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .runners {
            padding-top: env(safe-area-inset-top);
            padding-bottom: env(safe-area-inset-bottom);
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
        }

        .runners .tracker-panel {
            padding-bottom: max(1rem, env(safe-area-inset-bottom));
        }

        .runners .map-controls {
            top: max(0.75rem, env(safe-area-inset-top));
            left: max(0.75rem, env(safe-area-inset-left));
        }

        .runners .route-controls {
            bottom: max(0.75rem, env(safe-area-inset-bottom));
            right: max(0.75rem, env(safe-area-inset-right));
        }
    }
}

/* Spezifische Fixes für Select-Optionen auf iOS */
@supports (-webkit-touch-callout: none) {
    .runners .route-controls select {
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }

    .runners .route-controls select option {
        font-size: 14px;
    }
}

/* Fix für Firefox Select Optionen */
@-moz-document url-prefix() {
    .runners .route-controls select {
        text-indent: 0.01px;
        text-overflow: '';
    }

    .runners .route-controls select option {
        padding: 5px;
        background-color: white;
        color: #1e5799;
    }
}