/* Stop schedule page */
.stop-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin-bottom: 1.75rem;
}

.stop-status-card {
    --status-stripe: 4px;
    --status-radius: 0.85rem;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    min-height: 96px;
    padding: 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.045);
}

.stop-status-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: var(--status-radius);
    bottom: var(--status-radius);
    width: var(--status-stripe);
    border-radius: 0;
    background: var(--status-accent, #64748b);
}

.stop-status-card.route {
    --status-accent: #3b82f6;
    --status-soft: #eff6ff;
}

.stop-status-card.prev {
    --status-accent: #94a3b8;
    --status-soft: #f1f5f9;
}

.stop-status-card.next {
    --status-accent: #22c55e;
    --status-soft: #dcfce7;
    background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
    border-color: #bbf7d0;
    box-shadow: 0 12px 26px rgba(22, 163, 74, 0.08), inset 0 0 0 1px rgba(34, 197, 94, 0.08);
}

.stop-status-card.day {
    --status-accent: #6366f1;
    --status-soft: #eef2ff;
    background: linear-gradient(180deg, #f8faff 0%, #f4f6ff 100%);
    border-color: #c7d2fe;
}

.stop-status-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 0.75rem;
    background: var(--status-soft, #eff6ff);
    color: var(--status-accent, #64748b);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.stop-status-card.prev .stop-status-icon,
.stop-status-card.day .stop-status-icon {
    background: var(--status-soft, #ffffff);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.08);
}

.stop-status-card.next .stop-status-icon {
    background: #22c55e;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(34, 197, 94, 0.22);
}

.stop-status-icon svg {
    width: 19px;
    height: 19px;
}

.stop-status-body {
    min-width: 0;
    flex: 1 1 auto;
}

.stop-status-label {
    margin-bottom: 0.2rem;
    color: var(--status-accent, #64748b);
    font-size: 9px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.stop-status-main {
    color: #0f172a;
    font-size: 0.96rem;
    line-height: 1.2;
    font-weight: 900;
}

.stop-status-route-number {
    margin-bottom: 0.2rem;
    color: #0f172a;
    font-size: 1rem;
    line-height: 1.1;
    font-weight: 900;
}

.stop-status-direction {
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.72rem;
    line-height: 1.35;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stop-status-time-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.45rem;
}

.stop-status-time {
    color: #0f172a;
    font-size: 1.45rem;
    line-height: 1;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.stop-status-card.next .stop-status-time,
.stop-status-card.next .stop-status-info,
.stop-status-card.next .stop-status-label {
    color: #16a34a;
}

.stop-status-info {
    color: #94a3b8;
    font-size: 0.7rem;
    line-height: 1.2;
    font-weight: 800;
}

.stop-status-note {
    margin-top: 0;
    position: relative;
    width: 20px;
    height: 20px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #ffffff;
    color: #64748b;
    font-size: 10px;
    line-height: 1;
    font-weight: 900;
    text-transform: uppercase;
    cursor: help;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.stop-status-note.hidden {
    display: none !important;
}

.stop-status-card.next .stop-status-note {
    border-color: #bbf7d0;
    background: rgba(255, 255, 255, 0.82);
    color: #15803d;
}

.stop-status-note::after {
    content: attr(data-note);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(2px);
    width: max-content;
    max-width: min(280px, 70vw);
    padding: 7px 9px;
    border-radius: 7px;
    background: #1e2b4d;
    color: #ffffff;
    font-size: 11px;
    line-height: 1.25;
    font-weight: 800;
    text-align: left;
    text-transform: none;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
    z-index: 40;
}

.stop-status-note::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 3px);
    width: 8px;
    height: 8px;
    background: #1e2b4d;
    transform: translateX(-50%) rotate(45deg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 39;
}

.stop-status-note:hover::after,
.stop-status-note:focus-visible::after,
.stop-status-note:hover::before,
.stop-status-note:focus-visible::before {
    opacity: 1;
}

.stop-status-note:hover::after,
.stop-status-note:focus-visible::after {
    transform: translateX(-50%) translateY(0);
}

@media (min-width: 1024px) {
    .stop-status-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.85rem;
        margin-bottom: 2.25rem;
    }

    .stop-status-card {
        min-height: 112px;
        padding: 1rem;
    }
}

@media (max-width: 520px) {
    .stop-status-grid {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: calc(100vw - 2rem);
        gap: 0.55rem;
        margin-bottom: 1.35rem;
    }

    .stop-status-card {
        --status-stripe: 3px;
        --status-radius: 0.75rem;
        min-height: 78px;
        padding: 0.72rem 0.8rem;
        gap: 0.55rem;
        border-radius: 0.75rem;
    }

    .stop-status-card::before {
        width: var(--status-stripe);
    }

    .stop-status-icon {
        width: 30px;
        height: 30px;
        border-radius: 0.6rem;
    }

    .stop-status-icon svg {
        width: 16px;
        height: 16px;
    }

    .stop-status-label {
        font-size: 8px;
        letter-spacing: 0;
    }

    .stop-status-route-number,
    .stop-status-main {
        font-size: 0.86rem;
    }

    .stop-status-time {
        font-size: 1.15rem;
    }

    .stop-status-info,
    .stop-status-direction {
        font-size: 0.64rem;
    }
}

@media (min-width: 768px) {
    .seo-h1 {
        font-size: 2.25rem;
    }
}

.time-item {
    position: relative;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 6px 8px !important;
    text-align: left !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    font-weight: 700;
    color: #334155;
    background: white;
    transition: all 0.2s;
}

.time-item > a,
.time-item > span,
.time-item > div:not(.active-badge) {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    width: 100% !important;
}

.time-item:hover { 
    border-color: #3b82f6; 
}
.time-item > a.time-link {
    display: inline-flex !important;
    position: relative;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: auto !important;
    min-width: 0 !important;
    text-align: center !important;
    line-height: 1.1 !important;
    color: inherit;
}

.time-item .time-main {
    line-height: 1.1;
}

.time-item .time-note {
    position: static;
    flex: 0 0 auto;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 9px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
    box-shadow: none;
}

.time-item .time-note-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.time-item .time-note-text {
    display: none;
}

.time-item .time-note::after {
    content: attr(data-note);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(2px);
    width: max-content;
    max-width: min(280px, 70vw);
    padding: 7px 9px;
    border-radius: 7px;
    background: #1e2b4d;
    color: #ffffff;
    font-size: 11px;
    line-height: 1.25;
    font-weight: 800;
    text-align: left;
    text-transform: none;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
    z-index: 30;
}

.time-item .time-note::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 3px);
    width: 8px;
    height: 8px;
    background: #1e2b4d;
    transform: translateX(-50%) rotate(45deg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 29;
}

.time-item .time-note:hover::after,
.time-item .time-note:hover::before {
    opacity: 1;
}

.time-item .time-note:hover::after {
    transform: translateX(-50%) translateY(0);
}

.time-item.active-bus .time-note {
    background: #dcfce7;
    border-color: #86efac;
    color: #047857;
}

.schedule-note-legend {
    margin: 16px 0 24px;
    width: 100%;
    max-width: none;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #f8fafc;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.schedule-note-legend-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e2b4d;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.schedule-note-legend-title i {
    color: #3b82f6;
}

.schedule-note-legend-list {
    display: grid;
    gap: 0;
    max-height: 260px;
    overflow: auto;
}

.schedule-note-legend-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px 14px;
    border-top: 1px solid #eef2f7;
}

.schedule-note-legend-item:first-child {
    border-top: 0;
}

.schedule-note-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 11px;
    line-height: 1;
    font-weight: 900;
    text-transform: uppercase;
}

.schedule-note-body {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.schedule-note-times {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.schedule-note-time {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #dbeafe;
    color: #1e2b4d;
    font-size: 11px;
    line-height: 1;
    font-weight: 900;
}

.schedule-note-time-more {
    color: #64748b;
    border-color: #e2e8f0;
}

.schedule-note-copy {
    color: #475569;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .time-item.has-note {
        min-width: 60px !important;
        flex: 0 0 auto !important;
        max-width: none !important;
        padding: 6px 8px !important;
    }

    .time-item.has-note > a.time-link {
        width: auto !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        text-align: center !important;
    }

    .time-item .time-note {
        position: static;
        width: auto;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 999px;
        justify-content: center;
        background: #eff6ff;
        border-color: #dbeafe;
        color: #1d4ed8;
        font-size: 9px;
        line-height: 1;
        font-weight: 900;
        text-align: center;
        text-transform: uppercase;
        box-shadow: none;
    }

    .time-item .time-note::before,
    .time-item .time-note::after {
        display: none;
    }

    .time-item .time-note-mark {
        display: inline-flex;
    }

    .time-item .time-note-text {
        display: none;
    }

    .time-item.active-bus .time-note {
        background: #ecfdf5;
        border-color: #bbf7d0;
        color: #047857;
    }

    .schedule-note-legend {
        margin: 14px 0 18px;
        border-radius: 10px;
    }

    .schedule-note-legend-title {
        padding: 10px 12px;
        font-size: 11px;
    }

    .schedule-note-legend-item {
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 8px;
        padding: 9px 12px;
    }

    .schedule-note-code {
        width: 22px;
        height: 22px;
        border-radius: 6px;
        font-size: 10px;
    }

    .schedule-note-legend-list {
        max-height: 230px;
    }

    .schedule-note-time {
        height: 19px;
        padding: 0 6px;
        font-size: 10px;
    }

    .schedule-note-copy {
        font-size: 12px;
    }
}

.time-item small, 
.time-item sup, 
.time-item span[style], 
.time-item font {
    display: block !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
    color: #64748b !important;
    background-color: #f8fafc !important;
    padding: 3px 4px !important;
    border-radius: 4px !important;
    margin-top: 4px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    border: 1px solid #e2e8f0 !important;
    text-align: left !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.time-item.active-bus {
    background-color: #ffffff !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 1px #10b981 !important;
    color: #10b981 !important;
}

.time-item.active-bus small, 
.time-item.active-bus sup, 
.time-item.active-bus span[style], 
.time-item.active-bus font {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    border-color: #bbf7d0 !important;
}

.time-item.active-bus .active-badge {
    display: block;
    background-color: #10b981 !important;
    color: #ffffff !important;
    top: -10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 9px;
    white-space: nowrap;
    width: max-content;
}

.time-item.departed-bus {
    background-color: #ffffff !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
    color: #ef4444 !important;
}

.time-item.departed-bus .active-badge {
    display: block;
    background-color: #ef4444 !important;
    color: #ffffff !important;
    top: -10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 9px;
    white-space: nowrap;
    width: max-content;
    z-index: 10;
}

.active-badge {
    display: none;
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #000;
    color: #fff;
    font-size: 0.5rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: 2px 4px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

@keyframes drive {
    0%, 100% { transform: translateY(-50%) translateX(-50%) rotate(0deg); }
    25% { transform: translateY(-53%) translateX(-50%) rotate(-1.5deg); }
    75% { transform: translateY(-47%) translateX(-50%) rotate(1.5deg); }
}

.bus-driving {
    animation: drive 3s ease-in-out infinite;
}

/* Кастомные классы для точек расписания */
.indicator-arriving {
    background-color: #22c55e !important; /* Зеленый */
    box-shadow: 0 0 0 4px #dcfce7;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.indicator-departed {
    background-color: #ef4444 !important; /* Красный */
    box-shadow: 0 0 0 4px #fee2e2;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.indicator-default {
    background-color: #e2e8f0 !important; /* Серый */
    box-shadow: none;
    animation: none;
}
