/* Station markers */

.station-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.subway-marker {
    color: #005aaa;
    font-size: 28px;
    text-shadow: 0 0 8px rgba(0, 90, 170, 0.9);
}

.suburban-marker {
    color: #00843d;
    font-size: 28px;
    text-shadow: 0 0 8px rgba(0, 132, 61, 0.9);
}

.bus-marker {
    color: #ffd200;
    font-size: 16px;
    text-shadow: 0 0 6px rgba(255, 210, 0, 0.9);
}

/* Leaflet popup */

.leaflet-popup {
    max-width: none !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background:
        linear-gradient(
            145deg,
            rgba(51, 60, 78, 0.96),
            rgba(25, 31, 45, 0.96)
        ) !important;

    color: var(--text-main) !important;
    border: 1px solid rgba(255, 255, 255, 0.16);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 24px 70px rgba(0, 0, 0, 0.5) !important;

    backdrop-filter: blur(28px) saturate(1.35);
    -webkit-backdrop-filter: blur(28px) saturate(1.35);
}

.leaflet-popup-content-wrapper {
    width: auto !important;
    max-width: none !important;
    overflow: hidden;
    border-radius: 28px !important;
}

.leaflet-popup-content {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    color: #ffffff !important;
}

.leaflet-popup-close-button {
    display: none;
}

.leaflet-popup-tip {
    border: 1px solid rgba(255, 255, 255, 0.16);
}

/* Attribution */

.leaflet-control-attribution {
    padding: 2px 6px;
    border-radius: 8px;

    color: #9ca3af;
    background: rgba(0, 0, 0, 0.35) !important;

    font-size: 10px;
    opacity: 0.45;

    backdrop-filter: blur(8px);
}

.leaflet-control-attribution a {
    color: var(--text-muted);
}

/* Station popup */

.station-popup {
    font-family: "Geist", system-ui, sans-serif;
}

.station-popup-v2 {
    width: 410px;
    max-width: calc(100vw - 32px);

    overflow: hidden;
    border-radius: 28px;

    color: var(--text-main);
    background:
        linear-gradient(
            145deg,
            rgba(51, 60, 78, 0.96),
            rgba(25, 31, 45, 0.96)
        );
}

.station-popup-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;

    padding: 23px 21px 17px;
}

.station-popup-title-group {
    min-width: 0;
}

.station-title {
    margin: 0;
    overflow: hidden;

    color: rgba(255, 255, 255, 0.96);

    font-size: 24px;
    font-weight: 820;
    letter-spacing: -0.04em;
    line-height: 1.08;

    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Station lines */

.station-lines {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;

    margin-top: 12px;
    max-width: 310px;
}

.station-fallback-notice {
    margin-top: 10px;

    color: #fdba74;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.station-line-item {
    display: inline-flex;
}

.station-line-hidden {
    display: none;
}

.station-lines.expanded .station-line-hidden {
    display: inline-flex;
}

.station-lines .line-badge {
    min-width: auto;
    height: 26px;
    padding: 0 9px;

    font-size: 12px;
    font-weight: 850;
}

.station-lines-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 26px;
    min-width: 38px;
    padding: 0 10px;

    border: none;
    border-radius: 999px;

    color: rgba(255, 255, 255, 0.96);
    background: rgba(255, 255, 255, 0.16);

    font-family: "Geist", system-ui, sans-serif;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;

    cursor: pointer;
    transition:
        background 0.18s ease,
        transform 0.18s ease;
}

.station-lines-toggle:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}

.station-line-placeholder {
    color: rgba(255, 255, 255, 0.48);

    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0.01em;
}

/* Favorite button */

.station-favorite-button {
    flex: 0 0 auto;

    width: 39px;
    height: 39px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(250, 204, 21, 0.38);
    border-radius: 999px;

    color: #facc15;
    cursor: pointer;
    background: rgba(250, 204, 21, 0.08);

    font-family: "Geist", system-ui, sans-serif;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;

    text-align: center;
    appearance: none;
    -webkit-appearance: none;
}

.station-favorite-button:hover,
.station-favorite-button.active {
    border-color: rgba(250, 204, 21, 0.7);
    background: rgba(250, 204, 21, 0.16);
    transform: scale(1.04);
}

/* Departures */

.station-departures-wrapper {
    position: relative;
    overflow: hidden;
}

.station-departures {
    max-height: 385px;
    overflow-y: auto;
    overflow-x: hidden;

    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 16px;
    scroll-padding-bottom: 16px;

    scrollbar-width: none;
    -ms-overflow-style: none;
}

.station-departures::-webkit-scrollbar {
    display: none;
}

.station-departures.has-fade {
    mask-image: linear-gradient(
        to bottom,
        black 0%,
        black calc(100% - 72px),
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        black 0%,
        black calc(100% - 72px),
        transparent 100%
    );
}

.popup-departure-card {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 92px;
    align-items: center;
    gap: 12px;

    min-height: 76px;
    padding: 0 16px;
    margin: 0 16px;

    border-radius: 18px;

    cursor: pointer;
    background: rgba(255, 255, 255, 0.035);
    outline: 1px solid rgba(255, 255, 255, 0.035);
    outline-offset: -1px;

    transition:
        background 0.18s ease,
        outline-color 0.18s ease;
}

.popup-departure-card:hover {
    background: rgba(255, 255, 255, 0.065);
    outline-color: rgba(255, 255, 255, 0.11);
}

.popup-departure-surface {
    display: contents;
}

.popup-departure-left {
    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.popup-departure-center {
    min-width: 0;
}

.popup-departure-direction {
    overflow: hidden;

    color: rgba(255, 255, 255, 0.92);

    font-size: 17px;
    font-weight: 740;
    letter-spacing: -0.025em;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.popup-departure-relative {
    margin-top: 5px;

    color: rgba(255, 255, 255, 0.52);

    font-size: 12px;
    font-weight: 600;
}

.popup-departure-right {
    min-width: 0;
    text-align: right;
}

.popup-departure-time-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.popup-departure-times {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 6px;

    white-space: nowrap;
}

.popup-planned-time {
    color: rgba(255, 255, 255, 0.36);

    font-size: 12px;
    font-weight: 600;

    text-decoration: line-through;
    white-space: nowrap;
}

.popup-realtime {
    color: rgba(255, 255, 255, 0.96);

    font-size: 21px;
    font-weight: 850;
    letter-spacing: -0.04em;

    white-space: nowrap;
}

.popup-delay {
    font-size: 13px;
    font-weight: 850;
}

.popup-delay.delay-small {
    color: #facc15;
}

.popup-delay.delay-large {
    color: #fb7185;
}

.empty-departures {
    padding: 18px 16px;

    color: rgba(255, 255, 255, 0.56);

    font-size: 14px;
    font-weight: 560;
}

/* Line badges */

.line-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 44px;
    height: 30px;
    padding: 0 10px;

    border-radius: 999px;

    font-size: 15px;
    font-weight: 850;
    line-height: 1;

    flex-shrink: 0;
}

/* Skeleton */

.popup-skeleton-card {
    height: 78px;
    border-top: 1px solid rgba(255, 255, 255, 0.055);

    background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.04),
            rgba(255, 255, 255, 0.09),
            rgba(255, 255, 255, 0.04)
        );

    background-size: 220% 100%;
    animation: popupSkeleton 1.2s ease infinite;
}

@keyframes popupSkeleton {
    from {
        background-position: 100% 0;
    }

    to {
        background-position: -100% 0;
    }
}

/* Responsive */

@media (max-width: 520px) {
    .station-popup-v2 {
        width: 382px;
        max-width: calc(100vw - 24px);
    }

    .station-popup-header {
        padding: 22px 20px 16px;
    }

    .station-title {
        font-size: 23px;
    }

    .station-lines {
        max-width: 285px;
        gap: 6px;
    }

    .station-lines .line-badge,
    .station-lines-toggle {
        height: 25px;
        font-size: 12px;
    }

    .popup-departure-card {
        grid-template-columns: 50px minmax(0, 1fr) 88px;
        gap: 10px;
    }

    .popup-departure-direction {
        font-size: 16px;
    }

    .popup-departure-relative {
        font-size: 12px;
    }

    .popup-planned-time {
        font-size: 11px;
    }

    .popup-realtime {
        font-size: 20px;
    }

    .line-badge {
        min-width: 42px;
        height: 29px;
        padding: 0 9px;

        font-size: 14px;
    }
}
