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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: #0a1628;
}

#map {
    width: 100vw;
    height: 100vh;
    background: #0a1628;
}

/* Info Panel - Top Left */
#info-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, rgba(10, 22, 40, 0.95), rgba(20, 40, 70, 0.9));
    border: 1px solid rgba(100, 180, 255, 0.3);
    border-radius: 12px;
    padding: 24px;
    color: white;
    z-index: 1000;
    min-width: 320px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.expedition-logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #00ffff;
    margin-bottom: 4px;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.7);
}

.expedition-logo h2 {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1px;
}

.stats {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(100, 180, 255, 0.2);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ffff, #00ccff);
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.7);
}

.leg-info {
    margin-top: 16px;
    padding: 12px;
    background: rgba(79, 195, 247, 0.1);
    border-radius: 8px;
    border-left: 3px solid #4fc3f7;
}

.leg-name {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Control Panel - Bottom Center */
#controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(10, 22, 40, 0.9);
    border: 1px solid rgba(100, 180, 255, 0.3);
    border-radius: 50px;
    padding: 12px 24px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(79, 195, 247, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(79, 195, 247, 0.4);
    transform: scale(1.1);
}

.control-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.control-btn .hidden {
    display: none;
}

#speed-slider {
    width: 100px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

#speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4fc3f7;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
}

#speed-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4fc3f7;
    cursor: pointer;
    border: none;
}

/* Legend - Bottom Left */
#legend {
    position: absolute;
    bottom: 30px;
    left: 20px;
    background: rgba(10, 22, 40, 0.9);
    border: 1px solid rgba(100, 180, 255, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    color: white;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

#legend h3 {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

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

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

.legend-dot.start {
    background: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.legend-dot.waypoint {
    background: #ff9800;
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.6);
}

.legend-line {
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, #4fc3f7, #29b6f6);
    border-radius: 2px;
}

/* Boat Marker Animation */
.boat-marker {
    transition: transform 0.1s linear;
}

.boat-icon {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 0 15px rgba(0, 255, 255, 1)) drop-shadow(0 0 30px rgba(0, 255, 255, 0.8));
}

/* Waypoint Popup Styling */
.leaflet-popup-content-wrapper {
    background: rgba(10, 22, 40, 0.95);
    border: 1px solid rgba(100, 180, 255, 0.3);
    border-radius: 10px;
    color: white;
}

.leaflet-popup-content {
    margin: 12px 16px;
}

.leaflet-popup-tip {
    background: rgba(10, 22, 40, 0.95);
    border: 1px solid rgba(100, 180, 255, 0.3);
}

.waypoint-popup h4 {
    font-size: 1rem;
    color: #4fc3f7;
    margin-bottom: 6px;
}

.waypoint-popup p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

/* Pulse Animation for Boat */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.9);
    }
    70% {
        box-shadow: 0 0 0 25px rgba(0, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 255, 0);
    }
}

.boat-pulse {
    animation: pulse 2s infinite;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Route Trail Effect */
.route-trail {
    stroke-dasharray: 10, 5;
    animation: dash 30s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -1000;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #info-panel {
        top: 10px;
        left: 10px;
        right: 10px;
        min-width: auto;
        padding: 16px;
    }

    .expedition-logo h1 {
        font-size: 1.3rem;
    }

    .stats {
        gap: 20px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    #controls {
        bottom: 20px;
        padding: 10px 16px;
    }

    #legend {
        display: none;
    }
}

/* Hide Leaflet Attribution in Fullscreen */
:fullscreen .leaflet-control-attribution {
    display: none;
}

/* Loading State */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5rem;
    z-index: 2000;
}

/* Water effect for map */
.leaflet-container {
    background: #000510;
}

/* Satellite imagery with good contrast */
.dark-tiles {
    filter: brightness(0.7) contrast(1.1) saturate(0.8);
}

/* Make route lines glow */
.leaflet-overlay-pane svg path {
    filter: drop-shadow(0 0 4px currentColor);
}
