/*
 * Остановки — Стили для мобильного приложения
 */

.stops-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: 
        radial-gradient(ellipse at top, rgba(255, 193, 7, 0.06) 0%, transparent 50%),
        var(--bg-primary);
}

/* Секции */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 8px 0 16px 0;
}

/* Шаг 1: Выбор маршрута */
.route-selection {
    padding: 20px;
}

.routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.route-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.route-btn:hover {
    background: var(--bg-card);
    border-color: rgba(0, 212, 170, 0.3);
    transform: translateY(-2px);
}

.route-btn:active {
    transform: translateY(0);
}

.route-btn .route-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-primary);
}

.route-btn .route-online {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.route-btn .route-online.has-online {
    color: var(--accent-primary);
}

/* Секция поиска */
.search-section {
    margin-top: 8px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    gap: 12px;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: var(--accent-primary);
}

.search-icon {
    font-size: 18px;
    opacity: 0.6;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-primary);
    font-family: inherit;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.clear-btn:hover {
    color: var(--text-primary);
}

/* Результаты поиска */
.search-results {
    margin-top: 16px;
}

.results-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0 0 12px 0;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Шаг 2: Направления */
.direction-selection,
.stops-list-view {
    padding: 20px;
}

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

.back-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.back-btn:hover {
    background: rgba(0, 212, 170, 0.1);
}

.route-badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-size: 18px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-family: 'JetBrains Mono', monospace;
}

.route-badge-sm {
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-size: 14px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
}

.directions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.direction-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-align: left;
    width: 100%;
}

.direction-btn:hover {
    background: var(--bg-card);
    border-color: rgba(0, 212, 170, 0.3);
}

.direction-btn-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.direction-btn-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.direction-btn-stops {
    font-size: 13px;
    color: var(--text-muted);
}

.direction-btn-arrow {
    color: var(--accent-primary);
    font-size: 20px;
}

/* Шаг 3: Список остановок */
.route-direction-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.direction-arrow {
    color: var(--text-muted);
    font-size: 16px;
}

.direction-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.stops-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stop-card {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-align: left;
    width: 100%;
    gap: 12px;
}

.stop-card:hover {
    background: var(--bg-card);
    transform: translateX(4px);
}

.stop-card:active {
    transform: translateX(2px);
}

.stop-card-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 24px;
}

.stop-card-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.stop-card-arrow {
    color: var(--text-muted);
    font-size: 16px;
}

/* Остановка с несколькими маршрутами (поиск) */
.stop-card-routes {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.route-tag {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
}

/* Шаг 4: Просмотр остановки */
.stop-view {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stop-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-card);
}

.stop-info {
    flex: 1;
    min-width: 0;
}

.stop-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stop-route-direction {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.favorite-btn .star {
    color: var(--text-muted);
    transition: color 0.2s;
}

.favorite-btn:hover .star {
    color: #ffc107;
}

.favorite-btn.active .star {
    color: #ffc107;
}

/* Контент прибытий */
.arrivals-content {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
}

/* Строка прибытия */
.arrival-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    gap: 14px;
}

.arrival-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.arrival-status.online {
    background: var(--accent-primary);
    box-shadow: 0 0 8px rgba(0, 212, 170, 0.5);
}

.arrival-status.assigned {
    background: #ffc107;
}

.arrival-status.unassigned {
    background: var(--text-muted);
}

.arrival-time-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 70px;
}

.arrival-minutes {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.arrival-minutes.soon {
    color: #ff6b6b;
}

.arrival-minutes.arriving {
    color: #ffc107;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.arrival-time-actual {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.arrival-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.arrival-vehicle {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.arrival-direction {
    font-size: 12px;
    color: var(--text-muted);
}

.arrival-deviation {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 12px;
    font-family: 'JetBrains Mono', monospace;
}

.arrival-deviation.on-time {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-primary);
}

.arrival-deviation.late {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}

.arrival-deviation.early {
    background: rgba(0, 168, 255, 0.15);
    color: #00a8ff;
}

/* Пустое состояние */
.no-arrivals {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

.empty-hint {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Информация об обновлении */
.update-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-top: 1px solid var(--bg-card);
}

.update-indicator {
    color: var(--accent-primary);
    animation: pulse 2s infinite;
}

/* Адаптивность */
@media (max-width: 480px) {
    .route-selection,
    .direction-selection,
    .stops-list-view {
        padding: 16px;
    }
    
    .arrivals-content {
        padding: 12px 16px;
    }
    
    .stop-header {
        padding: 12px 16px;
    }
    
    .routes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .route-btn {
        padding: 16px 12px;
    }
    
    .route-btn .route-number {
        font-size: 28px;
    }
}

/* Скрытие элементов */
.hidden {
    display: none !important;
}
