.gpx-popup {
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    min-width: 220px;
}

.gpx-popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.gpx-popup-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.gpx-popup-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.gpx-popup-body {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

.gpx-popup-row {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.gpx-popup-label {
    color: #6b7280;
}

.gpx-popup-value {
    font-weight: 600;
}

.gpx-popup-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    justify-content: space-between;
}

/* override leaflet default */
.leaflet-popup-content {
    margin: 12px 14px;
}

.leaflet-popup-content-wrapper {
    border-radius: 14px;
}

.draggable-line {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    background-color: #3b82f6;
    cursor: col-resize;
    z-index: 10;
}

.elevation-chart-container {
    position: relative;
}

.marker-info {
    position: absolute;
    background-color: white;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    min-width: 200px;
}

.map-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.leaflet-popup-content {
    font-size: 14px;
}

.stats-card {
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

#markerInfo {
    pointer-events: none;
    /* Mouse akan "menembus" tooltip dan tetap fokus ke chart */
    user-select: none;
}

#draggableLine {
    pointer-events: none;
    /* Agar tidak menghalangi hover pada canvas di bawahnya */
}

.leaflet-container {
    background: #020617 !important;
}

.leaflet-tile {
    filter: brightness(0.5) invert(1) contrast(0.9) hue-rotate(180deg) !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    background: #0f172a !important;
    color: white !important;
    border-color: #1e293b !important;
}

/* Scrollbar Styling */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Chart Customization */
canvas#elevationChart {
    touch-action: pan-y;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.stats-card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats-card-hover:hover {
    transform: translateY(-4px);
    border-color: #10b981;
}

/* Responsivitas Tinggi Chart */
@media (max-width: 640px) {
    .gpx-popup .leaflet-popup-content-wrapper {
        min-width: 180px;
        /* Lebih ramping di mobile */
    }
}

/* nav */
.tab-btn {
    @apply relative transition-all duration-500;
    background: rgba(30, 41, 59, 0.3);
}

.tab-btn:hover:not(.active) {
    @apply bg-slate-800/50;
}

.tab-btn.active {
    @apply text-black;
    background: linear-gradient(145deg, #ef4444, #dc2626);
    box-shadow:
        0 4px 6px -1px rgba(220, 38, 38, 0.3),
        0 2px 4px -1px rgba(220, 38, 38, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}
/* Mobile (320px - 639px): 2 kolom, tinggi lebih kecil */
@media (max-width: 639px) {
    .tab-btn {
        min-height: 70px;
        padding: 8px 6px !important;
    }

    .tab-btn i {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .tab-btn span {
        font-size: 9px;
        line-height: 1.2;
    }
}

/* Tablet (640px - 767px): 3 kolom, ukuran sedang */
@media (min-width: 640px) and (max-width: 767px) {
    .tab-btn {
        min-height: 80px;
        padding: 10px 8px !important;
    }

    .tab-btn i {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .tab-btn span {
        font-size: 10px;
        line-height: 1.3;
    }
}

/* Desktop (768px ke atas): horizontal layout */
@media (min-width: 768px) {
    .tab-btn {
        min-width: 140px;
        min-height: auto;
        flex-direction: row !important;
        padding: 12px 16px !important;
    }

    .tab-btn i {
        margin-right: 8px;
        margin-bottom: 0 !important;
        font-size: 14px;
    }

    .tab-btn span {
        font-size: 11px;
        white-space: nowrap;
    }

    /* Underline effect hanya di desktop */
    .tab-btn::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 2px;
        background: #dc2626;
        transition: width 0.3s ease;
    }

    .tab-btn:hover::after {
        width: 80%;
    }
}

/* Large Desktop (1024px ke atas): lebih lebar */
@media (min-width: 1024px) {
    .tab-btn {
        min-width: 160px;
        padding: 16px 20px !important;
    }

    .tab-btn i {
        font-size: 16px;
        margin-right: 10px;
    }

    .tab-btn span {
        font-size: 12px;
    }
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
    .tab-btn:active {
        transform: scale(0.98);
    }

    .tab-btn.active:active {
        transform: scale(0.98) translateY(-1px);
    }
}

/* Smooth scroll untuk mobile */
@media (max-width: 767px) {
    .scrollbar-hide {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .scrollbar-hide::-webkit-scrollbar {
        display: none;
    }
}

/* WS */
.station-card.active div {
    border-color: rgba(59, 130, 246, 0.5) !important;
    background: linear-gradient(
        to right,
        rgba(30, 41, 59, 0.7),
        rgba(15, 23, 42, 0.5)
    ) !important;
}

.glass-dark {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
}

.station-card:hover .station-icon {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}
