.admin-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.admin-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.admin-header h1 {
    color: white;
    margin: 0 0 1rem 0;
    text-align: left;
}

.admin-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box input {
    padding-right: 2.5rem;
}

.search-box button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

.admin-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem;
}

.sidebar {
    width: 100%;
    margin-bottom: 1rem;
}

.main-content {
    flex: 1;
}

.admin-map {
    height: 400px;
    width: 100%;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    box-shadow: var(--box-shadow);
}

.users-list {
    max-height: 300px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: var(--transition);
}

.user-item:hover {
    background-color: #f5f7fa;
}

.user-item.active {
    background-color: rgba(52, 152, 219, 0.1);
    border-left: 3px solid var(--secondary-color);
}

.user-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.75rem;
}

.status-online {
    background-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
}

.status-recent {
    background-color: var(--warning-color);
}

.status-offline {
    background-color: #aaa;
}

.user-name {
    flex: 1;
    font-weight: 500;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.user-actions button {
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.user-actions button:hover {
    color: var(--secondary-color);
}

.favorite-btn.active {
    color: var(--warning-color);
}

.routes-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.routes-controls select {
    flex: 1;
}

.waypoints-list {
    max-height: 200px;
    overflow-y: auto;
}

.waypoint-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
}

.waypoint-name {
    flex: 1;
    font-size: 0.9rem;
}

.waypoint-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 10px;
}

.waypoint-actions .btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#add-waypoint {
    grid-column: 1 / -1;
}

#reimport-route-btn {
    font-size: 0.75rem;
}

#reverse-route-btn {
    font-size: 0.75rem;
}

#download-route-btn {
    font-size: 0.75rem;
}

.waypoint-marker .waypoint-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #33cc33;
    border: 2px solid white;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
}

.waypoint-marker .waypoint-label {
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
    margin-top: 2px;
    text-shadow: 1px 1px 1px white;
    font-weight: bold;
}

.settings-group {
    margin-bottom: 1.5rem;
}

.settings-group h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

.setting-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.checkbox-setting {
    display: flex;
    align-items: center;
}

.checkbox-setting input[type="checkbox"] {
    margin-right: 8px;
}

.setting-item label {
    flex: 1;
    margin-bottom: 0;
}

.color-picker {
    width: 40px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.range-slider {
    width: 100px;
}

.settings-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.user-details {
    margin-top: 1rem;
}

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

.user-details-name {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 500;
}

.user-details-actions {
    display: flex;
    gap: 0.5rem;
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: #777;
}

.user-timeline {
    margin-top: 1rem;
}

.timeline-item {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.timeline-time {
    width: 80px;
    color: #777;
}

.timeline-info {
    flex: 1;
}

.admin-footer {
    background-color: #f8f9fa;
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.back-link {
    color: var(--secondary-color);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal {
    background-color: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    position: relative;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
}

.modal-content {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 1rem;
    color: #777;
}

.no-route-selected, .no-user-selected {
    text-align: center;
    padding: 1rem;
    color: #777;
    font-style: italic;
}

/* Alert-Box für Re-Import Modal */
.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Re-Import Button Styling */
#reimport-route-btn {
    background-color: #17a2b8;
    color: white;
    border: 1px solid #17a2b8;
}

#reimport-route-btn:hover {
    background-color: #138496;
    border-color: #117a8b;
}

/* Checkbox-Gruppe im Modal */
.checkbox-group {
    margin: 10px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    margin-left: 0;
}

/* Responsive Anpassungen für größere Bildschirme */
@media (min-width: 768px) {
    .admin-content {
        flex-direction: row;
        gap: 1rem;
    }
    
    .sidebar {
        width: 300px;
        margin-bottom: 0;
    }
    
    .admin-map {
        height: 500px;
    }
}

@media (min-width: 992px) {
    .sidebar {
        width: 350px;
    }
    
    .admin-map {
        height: 600px;
    }
}

/* KM-Marker Styles - Schlicht und Modern */
.km-marker-icon {
    text-align: center;
    font-weight: 500;
    font-size: 11px;
}

.km-marker-label {
    background-color: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(108, 117, 125, 0.3);
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 9px;
    font-weight: 500;
    color: #495057;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
    line-height: 1.2;
    min-width: 28px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.km-marker-label:hover {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.range-value {
    display: inline-block;
    min-width: 20px;
    text-align: center;
    font-weight: bold;
    color: #3498db;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
    font-size: 0.9rem;
}

.smoothing-stats {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.smoothing-stats h4 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1rem;
}

.smoothing-stats .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.smoothing-stats .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.smoothing-stats .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
}

.smoothing-stats .stat-value {
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.9rem;
}

.setting-item .btn {
    margin: 2px;
    font-size: 0.85rem;
    padding: 6px 12px;
}

.setting-item .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.setting-item .checkbox-group {
    margin-top: 8px;
}

.setting-item .checkbox-group .checkbox-setting {
    margin-bottom: 5px;
}

/* Positions-Info-Popup Styles */
.position-popup-container .leaflet-popup-content-wrapper {
    background-color: #f8f9fa;
    border: 2px solid #007bff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.position-popup-container .leaflet-popup-tip {
    background-color: #f8f9fa;
    border: 2px solid #007bff;
}

.position-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 320px;
}

.position-popup h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #007bff;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

.position-details {
    width: 100%;
    margin-bottom: 12px;
    font-size: 13px;
    border-collapse: collapse;
}

.position-details tr {
    border-bottom: 1px solid #f1f3f4;
}

.position-details td {
    padding: 6px 4px;
    vertical-align: top;
    word-wrap: break-word;
}

.position-details td:first-child {
    width: 40%;
    font-weight: 500;
    color: #495057;
}

.position-details td:last-child {
    width: 60%;
    color: #212529;
    font-size: 12px;
    line-height: 1.3;
}

/* Spezielle Formatierung für Koordinaten */
.position-details tr:first-child td:last-child {
    font-family: 'Monaco', 'Menlo', monospace;
}

/* Spezielle Formatierung für Adressen */
.position-details #address-value {
    font-family: inherit;
    font-weight: 500;
}

.position-links {
    margin-bottom: 10px;
    text-align: center;
}

.position-links a {
    display: inline-block;
    margin: 3px 0;
    padding: 6px 12px;
    background-color: #007bff;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.position-links a:hover {
    background-color: #0056b3;
    text-decoration: none;
}

.position-note {
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid #dee2e6;
}

.position-note small {
    color: #6c757d;
    font-style: italic;
}

/* Animation für Positions-Info-Popup */
.position-popup-container .leaflet-popup-content-wrapper {
    animation: positionPopupFadeIn 0.3s ease-out;
}

@keyframes positionPopupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Aktiver Zustand für Toggle-Buttons */
.btn.active {
    background-color: #28a745 !important;
    color: white !important;
}

/* Responsive Anpassung für sehr kleine Bildschirme */
@media (max-width: 350px) {
    .waypoint-actions {
        grid-template-columns: 1fr;
    }
    
    .waypoint-actions .btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Moderne Steuerungselemente (aus Embed übernommen) */
.visibility-controls.modern-style {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 10px;
}

.modern-btn {
    background: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.2s;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    text-align: left;
}

.modern-btn:last-child {
    border-bottom: none;
}

.modern-btn:hover {
    background-color: #f5f5f5;
}

.modern-btn.active {
    background-color: #007cba;
    color: white;
}

.modern-btn i {
    font-size: 12px;
    width: 14px;
    text-align: center;
}

/* Route-Info-Box (aus Embed übernommen) */
.route-info-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 12px;
    max-width: 280px;
    margin-bottom: 10px;
}

.route-info-content {
    padding: 12px;
}

.route-info-box h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.route-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.route-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
}

.route-stat-value {
    font-weight: bold;
    color: #007cba;
    font-size: 13px;
}

.route-stat-label {
    color: #666;
    font-size: 10px;
    margin-top: 2px;
}

/* Responsive Anpassungen für Route-Info-Box */
@media (max-width: 768px) {
    .route-info-box {
        max-width: none;
        left: 5px !important;
        right: 5px !important;
        width: auto !important;
    }
    
    .route-info-content {
        padding: 10px;
    }
    
    .route-info-box h3 {
        font-size: 13px;
    }
    
    .route-stats {
        gap: 12px;
    }
}


