/**
 * Warp Map Frontend Styles
 */

.warp-map-container {
    position: relative;
    width: 100%;
    max-height: 1024px;
    overflow: hidden;
    /* border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); */
    background: unset!important;
    margin: 20px 0;
}

.warp-map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: #f9f9f9;
    color: #666;
    font-style: italic;
}

/* Leaflet Karte anpassen */
.warp-map-container .leaflet-container {
    border-radius: 8px;
}

.warp-map-container .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.warp-map-container .leaflet-popup-content {
    margin: 12px 16px;
    line-height: 1.4;
}

/* Statistiken Control */
.warp-map-stats-control {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-width: 250px;
    max-width: 300px;
}

.warp-map-stats h4 {
    margin: 0 0 12px 0;
    color: #1e40af;
    font-size: 16px;
    font-weight: 600;
}

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

.stat-item {
    display: flex;
    flex-direction: column;
    padding: 8px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.stat-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 14px;
    color: #1e40af;
    font-weight: 600;
    margin-top: 2px;
}

/* Höhenprofil Control */
.warp-map-elevation-control {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-width: 320px;
    max-width: 400px;
}

.elevation-profile h4 {
    margin: 0 0 12px 0;
    color: #1e40af;
    font-size: 16px;
    font-weight: 600;
}

/* Höhenprofil außerhalb der Karte */
.warp-map-elevation-profile {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.warp-map-elevation-profile h3 {
    margin: 0 0 15px 0;
    color: #374151;
    font-size: 18px;
    font-weight: 600;
}

.warp-map-elevation-profile canvas {
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    max-width: 100%;
    height: auto;
}

/* Responsive Höhenprofil */
@media (max-width: 768px) {
    .warp-map-elevation-profile {
        padding: 15px;
        margin-top: 15px;
    }
    
    .warp-map-elevation-profile canvas {
        width: 100%;
        height: auto;
    }
}

/* Leaflet Control Anpassungen */
.leaflet-control-container .leaflet-top.leaflet-right {
    top: 10px;
    right: 10px;
}

.leaflet-control-container .leaflet-bottom.leaflet-right {
    bottom: 10px;
    right: 10px;
}

/* Popup Styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px !important;
}

.leaflet-popup-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.leaflet-popup-content strong {
    color: #1e40af;
}

/* Marker Icons */
.leaflet-marker-icon {
    /* SVG-Icons mit integriertem Schatten */
}

/* Responsive Design */
@media (max-width: 768px) {
    .warp-map-container {
        margin: 10px 0;
        border-radius: 4px;
    }
    
    .warp-map-stats-control,
    .warp-map-elevation-control {
        min-width: 200px;
        max-width: 250px;
        padding: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .stat-item {
        padding: 6px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .warp-map-stats-control,
    .warp-map-elevation-control {
        min-width: 180px;
        max-width: 200px;
        padding: 10px;
    }
    
    .warp-map-stats h4,
    .elevation-profile h4 {
        font-size: 14px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .warp-map-stats-control,
    .warp-map-elevation-control {
        background: rgba(30, 41, 59, 0.95);
        color: #e2e8f0;
    }
    
    .warp-map-stats h4,
    .elevation-profile h4 {
        color: #60a5fa;
    }
    
    .stat-item {
        background: rgba(59, 130, 246, 0.1);
        border-left-color: #60a5fa;
    }
    
    .stat-label {
        color: #94a3b8;
    }
    
    .stat-value {
        color: #60a5fa;
    }
    
    .elevation-chart {
        background: #1e293b;
        border-color: #334155;
    }
}

/* POI Marker */
.poi-marker {
    border: none;
    box-shadow: none;
}

/* POI Control */
.poi-control {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-width: 200px;
    max-width: 250px;
}

/* Oberflächen-Statistik unter der Karte */
.warp-map-surface-stats {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    border: 1px solid #e2e8f0;
}

.surface-stats-header h4 {
    margin: 0 0 12px 0;
    color: #1e40af;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.surface-stats-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.surface-stat-item {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    background: rgba(248, 250, 252, 0.8);
}

.surface-stat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.surface-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #cbd5e1;
}

.surface-name {
    font-weight: 600;
    color: #374151;
    font-size: 13px;
}

.surface-stat-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.stat-label {
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    color: #1f2937;
    font-weight: 600;
}

.surface-stats-footer {
    margin-top: 10px;
    text-align: center;
    color: #6b7280;
    font-size: 11px;
    font-style: italic;
}

.poi-control-content h4 {
    margin: 0 0 12px 0;
    color: #1e40af;
    font-size: 14px;
    font-weight: 600;
}

.poi-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.poi-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
}

.poi-checkbox input[type="checkbox"] {
    margin: 0;
}

.poi-icon {
    font-size: 14px;
}

.poi-name {
    color: #374151;
    font-weight: 500;
}

.poi-refresh-btn {
    width: 100%;
    padding: 8px 12px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.poi-refresh-btn:hover {
    background: #2563eb;
}

/* Oberflächen-Ladeanzeige */
.surface-loading {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.surface-loading-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #374151;
    font-size: 14px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

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

/* Oberflächen-Legende */
.surface-legend {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-width: 150px;
}

.surface-legend-content h4 {
    margin: 0 0 10px 0;
    color: #1e40af;
    font-size: 14px;
    font-weight: 600;
}

.surface-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 12px;
}

.surface-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 8px;
    border: 1px solid #e2e8f0;
}

/* Erweiterte Statistiken */
.warp-map-advanced-stats {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-width: 280px;
    max-width: 320px;
}

.advanced-stats-content h4 {
    margin: 0 0 15px 0;
    color: #1e40af;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.stats-section {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.stats-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.stats-section h5 {
    margin: 0 0 8px 0;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-section .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
}

.stats-section .stat-label {
    color: #6b7280;
    font-weight: 500;
}

.stats-section .stat-value {
    color: #1e40af;
    font-weight: 600;
}

/* GestureHandling übernimmt den Zoom-Hinweis - keine eigenen Styles nötig */

/* Animationen */
.warp-map-container {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Animation */
.warp-map-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

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

/* GPX Track Styling - breiter und nach Oberflächen eingefärbt */
.gpx-track {
    stroke-width: 6;
    stroke-opacity: 0.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Oberflächen-spezifische GPX-Track-Farben */
.gpx-track-asphalt {
    stroke: #6b7280;
    stroke-width: 12;
}

.gpx-track-schotter {
    stroke: #d97706;
    stroke-width: 12;
}

.gpx-track-erde {
    stroke: #92400e;
    stroke-width: 12;
}

.gpx-track-waldweg {
    stroke: #059669;
    stroke-width: 12;
}

.gpx-track-unknown {
    stroke: #dc2626;
    stroke-width: 12;
}

/* POI Control Verbesserungen */
.poi-control-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.poi-btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.poi-btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.poi-btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.poi-btn-primary.loading {
    background: #6b7280;
    cursor: wait;
}

.poi-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.poi-btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* POI Loading Spinner */
.poi-loading-spinner {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-weight: 500;
    color: #374151;
}

.poi-loading-spinner .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 3-spaltige Statistik-Layout */
.stats-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 20px;
}

.stats-column {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.stats-column h5 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 8px;
}

.stats-column .stat-item {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.stats-column .stat-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Responsive Design für mobile Geräte */
@media (max-width: 768px) {
    .stats-grid-3col {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stats-column {
        padding: 16px;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .stats-grid-3col {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Dymaxion Projection Styles */
.warp-map-container.dymaxion-projection {
    /* Spezielle Stile für Dymaxion-Projektion */
    position: relative;
    overflow: hidden;
}

.warp-map-container.dymaxion-projection .leaflet-container {
    /* Anpassungen für Dymaxion-Karten */
    background: #f0f0f0;
}

.warp-map-container.dymaxion-projection .leaflet-control-zoom {
    /* Zoom-Controls für Dymaxion anpassen */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Dymaxion SVG-Maske Overlay */
.dymaxion-mask-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.dymaxion-mask-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Dymaxion SVG-Elemente korrekt skalieren */
.dymaxion-mask-overlay svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.dymaxion-lines-overlay svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Dymaxion-Maske Styling */
.leaflet-map-pane svg.dymaxion-mask-overlay {
    filter: drop-shadow(0 0 12px rgba(0,0,0,0.9));
    z-index: 1;
    /* Innerer Schatten für die Dymaxion-Maske */
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3), 
                inset 0 0 40px rgba(0,0,0,0.2),
                inset 0 0 60px rgba(0,0,0,0.1);
    /* Initial sichtbar */
    opacity: 1;
    transition: opacity 3s ease-out;
}

/* Dymaxion-Maske Fade-Out Animation */
.leaflet-map-pane svg.dymaxion-mask-overlay.fade-out {
    opacity: 0;
}

/* Dymaxion-Linien Overlay Styling */
.leaflet-map-pane svg.dymaxion-lines-overlay {
    z-index: 0;
    /* Innerer Schatten für die Dymaxion-Linien */
    /* box-shadow: inset 0 0 15px rgba(0,0,0,0.2), 
                inset 0 0 30px rgba(0,0,0,0.1); */
}

/* Reload-Button Styling */
.leaflet-control-reload {
    background: white;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s ease;
}

.leaflet-control-reload:hover {
    background: #f4f4f4;
    border-color: #999;
}

.leaflet-control-reload:active {
    background: #e6e6e6;
    transform: scale(0.95);
}

.leaflet-control-reload .reload-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}


/* Dymaxion Projection Info */
.dymaxion-info {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #333;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dymaxion-info .icon {
    color: #0066cc;
    margin-right: 5px;
}

/* Responsive Dymaxion-Maske */
@media (max-width: 768px) {
    .leaflet-map-pane  svg.dymaxion-mask-overlay {
        filter: drop-shadow(0 0 12px rgba(0,0,0,0.9));
        z-index: 1;
        /* Reduzierter innerer Schatten für mobile Geräte */
        box-shadow: inset 0 0 15px rgba(0,0,0,0.2), 
                    inset 0 0 30px rgba(0,0,0,0.15),
                    inset 0 0 45px rgba(0,0,0,0.1);
    }
    
    .leaflet-map-pane svg.dymaxion-lines-overlay {
        /* Reduzierter innerer Schatten für Linien auf mobilen Geräten */
        z-index: 0;
        /* box-shadow: inset 0 0 10px rgba(0,0,0,0.15), 
                    inset 0 0 20px rgba(0,0,0,0.1); */
    }
    
    .dymaxion-info {
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* POI-Layer Styling */
.poi-marker {
    background: transparent;
    border: none;
    border-radius: 50%;
}

.poi-icon {
    font-size: 18px;
    text-align: center;
    line-height: 1;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.6));
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poi-icon svg {
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.4));
    transition: all 0.2s ease;
    color: #28f8ed;
    fill: currentColor;
}

.poi-icon:hover {
    transform: scale(1.3);
    filter: drop-shadow(2px 2px 6px rgba(0,0,0,0.8));
}

.poi-icon:hover svg {
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.6));
    color: #2D3748;
}

/* POI-Popup Styling */
.leaflet-popup-content-wrapper .poi-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.leaflet-popup-content .poi-popup h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.leaflet-popup-content .poi-popup p {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: #666;
}

/* Kilometer-Marker Styles */
.km-marker-container {
    background: transparent;
    border: none;
}

.km-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #3b82f6;
    /* border: 1px solid #ffffff; */
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1;
}

.km-marker:hover {
    transform: scale(1.2);
    background: #004499;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}


