/* ============================================ */
/* OFFLINE MODAL - ПРОФЕССИОНАЛЬНЫЙ РЕДИЗАЙН    */
/* ============================================ */

/* Кнопка возврата вверх */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #667eea 100%);
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 998;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.5);
}

/* --- Контейнер модального окна --- */
.modal-notification {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-notification[style*="display: flex"] {
    opacity: 1;
}

/* --- Контент модального окна --- */
.modal-notification-content {
    background: var(--bg-card, #ffffff);
    border-radius: 24px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.05));
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s ease;
}

.modal-notification[style*="display: flex"] .modal-notification-content {
    transform: translateY(0);
}

/* --- Шапка модального окна --- */
.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color, #eaeef2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #1a2639);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--accent-blue, #007aff);
    font-size: 1.3rem;
}

.close-btn {
    background: var(--bg-secondary, #f2f5f9);
    border: none;
    color: var(--text-secondary, #5e6879);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.close-btn:hover {
    background: var(--bg-tertiary, #e9ecf0);
    color: var(--text-primary, #1a2639);
    transform: rotate(90deg);
}

/* --- Тело модального окна (с прокруткой) --- */
.modal-body {
    padding: 24px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color, #cbd5e0) transparent;
}

.modal-body::-webkit-scrollbar {
    width: 4px;
}
.modal-body::-webkit-scrollbar-thumb {
    background-color: var(--border-color, #cbd5e0);
    border-radius: 4px;
}

/* --- Уведомление о доступном обновлении (внутри окна) --- */
.update-available-card {
    background: #ffecba;
    border-left: 4px solid #ffb347;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    color: #5e3c0b;
}

[data-theme="dark"] .update-available-card {
    background: #3a2e1e;
    border-left-color: #ffa726;
    color: #ffd95b;
}

.update-available-card .update-icon {
    background: rgba(255, 180, 70, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #ff8c00;
    flex-shrink: 0;
}

.update-available-card .update-text h4 {
    margin: 0 0 4px 0;
    font-weight: 600;
    font-size: 1rem;
}

.update-available-card .update-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* --- Выбор сервера (горизонтальные карточки) --- */
.server-selector-block {
    margin-bottom: 20px;
}

.server-selector-block label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary, #5e6879);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.server-card {
    background: var(--bg-secondary, #f8fafc);
    border: 1.5px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.server-card.selected {
    border-color: var(--accent-blue, #007aff);
    background: rgba(0, 122, 255, 0.05);
}

.server-card .server-icon {
    position: relative;
    font-size: 1.6rem;
    color: var(--text-secondary, #5e6879);
}

.server-card.selected .server-icon {
    color: var(--accent-blue, #007aff);
}

/* Стили для индикатора статуса (пинга) */
.server-status-dot {
    position: absolute;
    top: -2px;
    right: -4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #a0aec0;
    border: 2px solid var(--bg-secondary, #f8fafc);
}

.server-status-dot.online { background: #10b981; }
.server-status-dot.offline { background: #ef4444; }
.server-status-dot.checking { background: #f59e0b; }

.server-card .server-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary, #2d3748);
    text-align: center;
    word-break: break-word;
    max-width: 100%;
}

/* --- Выбор города --- */
.city-selector-block {
    margin-bottom: 20px;
}

.city-selector-block label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary, #5e6879);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.city-select {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-secondary, #f8fafc);
    border: 1.5px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    color: var(--text-primary, #1a2639);
    font-size: 1rem;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.city-select:hover {
    border-color: var(--accent-blue, #007aff);
}

.city-select:focus {
    outline: none;
    border-color: var(--accent-blue, #007aff);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* --- КОМПАКТНЫЕ КАРТОЧКИ С ДАТАМИ --- */
.dates-grid.compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.date-card {
    background: var(--bg-secondary, #f8fafc);
    border-radius: 14px;
    padding: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-header.compact {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-icon-small {
    font-size: 0.9rem;
    color: var(--accent-blue, #007aff);
    width: 20px;
    text-align: center;
}

.date-card.local .date-icon-small {
    color: #10b981;
}

.date-title-small {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.date-card .date-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-card, #ffffff);
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    word-break: break-word;
    text-align: center;
}

/* Статусы дат */
.date-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 20px;
    align-self: flex-start;
}

.date-status-badge.up-to-date {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}
.date-status-badge.outdated {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}
.date-status-badge.unknown,
.date-status-badge.unavailable {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

/* --- Быстрые действия (кнопки с иконками) --- */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.quick-action-btn {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 20px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-btn i {
    font-size: 1.4rem;
    color: var(--text-secondary);
}

.quick-action-btn:not(:disabled):hover {
    background: var(--bg-tertiary, #edf2f7);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}
.quick-action-btn:not(:disabled):hover i {
    color: var(--accent-blue);
}

.quick-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* --- Основные действия (большие кнопки) --- */
.main-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.main-action-btn {
    padding: 16px;
    border: none;
    border-radius: 18px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-secondary, #f8fafc);
    color: var(--text-primary);
    border: 1px solid var(--border-color, #e2e8f0);
}

.main-action-btn.primary {
    background: var(--accent-blue, #007aff);
    color: white;
    border: none;
}
.main-action-btn.primary i { color: white; }

.main-action-btn.danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
[data-theme="dark"] .main-action-btn.danger {
    background: #4a1e1e;
    color: #fca5a5;
    border-color: #7f1d1d;
}
.main-action-btn.danger i { color: #b91c1c; }
[data-theme="dark"] .main-action-btn.danger i { color: #fca5a5; }


.main-action-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}
.main-action-btn.primary:not(:disabled):hover {
    box-shadow: 0 8px 18px rgba(0, 122, 255, 0.3);
}
.main-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Прогресс загрузки --- */
.update-progress-container {
    background: var(--bg-secondary, #f8fafc);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.update-progress-header {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.update-progress-bar {
    height: 10px;
    background: var(--bg-tertiary, #edf2f7);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}
.update-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007aff, #00c6fb);
    width: 0%;
    border-radius: 10px;
    transition: width 0.3s ease;
}
.update-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* --- Информационное сообщение о сервере/городе --- */
.server-info-banner {
    background: var(--bg-secondary, #f8fafc);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}
.server-info-banner i {
    font-size: 1.8rem;
    color: var(--accent-blue);
}
.server-info-banner .info-text {
    flex: 1;
}
.server-info-banner .info-text div:first-child {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 4px;
}
.server-info-banner .info-text div:last-child {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    word-break: break-word;
}

/* --- Адаптивность для мобильных устройств --- */
@media (max-width: 600px) {
    .modal-header {
        padding: 14px 18px;
    }
    .modal-header h3 {
        font-size: 1.1rem;
    }
    .modal-body {
        padding: 18px;
    }

    .servers-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 6px;
    }
    .server-card {
        padding: 10px 4px;
    }
    .server-card .server-icon {
        font-size: 1.4rem;
    }
    .server-card .server-name {
        font-size: 0.7rem;
    }

    .dates-grid.compact {
        gap: 8px;
    }

    .quick-actions {
        gap: 6px;
    }
    .quick-action-btn {
        padding: 10px 4px;
        border-radius: 16px;
    }
    .quick-action-btn i {
        font-size: 1.2rem;
    }

    .main-action-btn {
        padding: 14px;
        border-radius: 16px;
        font-size: 0.95rem;
    }
}

/* Темная тема */
[data-theme="dark"] .modal-notification-content {
    background: #1e1e2e;
    border-color: #2d2d3e;
}
[data-theme="dark"] .modal-header {
    border-bottom-color: #2d2d3e;
}
[data-theme="dark"] .close-btn {
    background: #2d2d3e;
    color: #a0aec0;
}
[data-theme="dark"] .server-card,
[data-theme="dark"] .date-card,
[data-theme="dark"] .quick-action-btn,
[data-theme="dark"] .city-select,
[data-theme="dark"] .update-progress-container,
[data-theme="dark"] .server-info-banner {
    background: #2d2d3e;
    border-color: #3d3d4e;
}
[data-theme="dark"] .server-card.selected {
    background: #2a2a3a;
    border-color: #007aff;
}
[data-theme="dark"] .main-action-btn {
    background: #2d2d3e;
    border-color: #3d3d4e;
}
[data-theme="dark"] .main-action-btn.primary {
    background: #007aff;
}
[data-theme="dark"] .date-status-badge {
    background: rgba(255,255,255,0.05);
}

/* ============================================ */
/* ДВУХЭТАПНЫЙ ПРОГРЕСС ЗАГРУЗКИ                */
/* ============================================ */

.two-step-progress-container {
    background: var(--bg-secondary, #f8fafc);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.progress-stage {
    background: var(--bg-card, #ffffff);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.progress-stage.active-stage {
    border-color: var(--accent-blue, #007aff);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1);
    background: linear-gradient(to right, var(--bg-card), rgba(0, 122, 255, 0.02));
}

.stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stage-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.stage-title i {
    color: var(--accent-blue, #007aff);
    font-size: 1.1rem;
}

.stage-title i.fa-ad {
    color: #ff9500;
}

.stage-status {
    font-size: 0.85rem;
}

.stage-status-text {
    color: var(--text-secondary);
}

.stage-status-text.active {
    color: var(--accent-blue, #007aff);
    font-weight: 500;
}

.stage-status-text.success {
    color: #10b981;
    font-weight: 500;
}

.stage-status-text.error {
    color: #ef4444;
    font-weight: 500;
}

.stage-progress-bar {
    height: 8px;
    background: var(--bg-tertiary, #edf2f7);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.stage-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue, #007aff), #00c6fb);
    width: 0%;
    border-radius: 8px;
    transition: width 0.3s ease;
}

.progress-stage.active-stage .stage-progress-fill {
    background: linear-gradient(90deg, var(--accent-blue, #007aff), #5a9eff);
}

.stage-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stage-percent {
    font-weight: 600;
    color: var(--text-primary);
}

.stage-speed {
    font-family: monospace;
}

.stage-size {
    font-family: monospace;
}

.two-step-complete-message {
    margin-top: 16px;
    padding: 16px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #10b981;
}

.two-step-complete-message .complete-icon {
    font-size: 2rem;
    color: #10b981;
}

.two-step-complete-message .complete-text h4 {
    margin: 0 0 4px 0;
    color: #10b981;
}

.two-step-complete-message .complete-text p {
    margin: 2px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Темная тема */
[data-theme="dark"] .progress-stage {
    background: #2d2d3e;
    border-color: #3d3d4e;
}

[data-theme="dark"] .progress-stage.active-stage {
    border-color: #007aff;
    background: linear-gradient(to right, #2d2d3e, rgba(0, 122, 255, 0.1));
}

[data-theme="dark"] .two-step-complete-message {
    background: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .two-step-complete-message .complete-text h4 {
    color: #34d399;
}

/* Кнопка "Понял" на всю ширину */
#understoodButtonContainer {
    width: 100%;
    margin-top: 20px;
}

#understoodButtonContainer .main-action-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    border-radius: 18px;
}

/* Упрощенное сообщение о завершении */
.two-step-complete-message {
    margin-top: 16px;
    padding: 16px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid #10b981;
}

.two-step-complete-message .complete-icon {
    font-size: 2rem;
    color: #10b981;
}

.two-step-complete-message .complete-text h4 {
    margin: 0;
    color: #10b981;
    font-size: 1.2rem;
}

/* ============================================ */
/* СТАТУСНЫЕ ИКОНКИ В ЗАГОЛОВКАХ КАРТОЧЕК       */
/* ============================================ */

.date-header.compact {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

/* Контейнер для иконки статуса */
.date-header.compact .status-icon {
    margin-left: auto; /* Прижимаем иконку к правому краю */
    font-size: 1rem;
}

/* Цвета для статусных иконок */
.date-header.compact .status-icon.success {
    color: #10b981;
}

.date-header.compact .status-icon.warning {
    color: #f59e0b;
}

.date-header.compact .status-icon.error {
    color: #ef4444;
}

.date-header.compact .status-icon.unknown {
    color: #64748b;
    opacity: 0.5;
}

/* Для темной темы */
[data-theme="dark"] .date-header.compact .status-icon.success {
    color: #34d399;
}

[data-theme="dark"] .date-header.compact .status-icon.warning {
    color: #fbbf24;
}

[data-theme="dark"] .date-header.compact .status-icon.error {
    color: #f87171;
}

[data-theme="dark"] .date-header.compact .status-icon.unknown {
    color: #94a3b8;
}

/* Убираем старые бейджи статусов, если они где-то остались */
.date-status-badge {
    display: none !important;
}

/* Для модального окна update-available тоже применяем новые стили */
.dates-grid .date-header .status-icon {
    font-size: 1rem;
}

/* ============================================ */
/* ВКЛАДКИ МАРШРУТОВ - ПРИЖАТЫ К ПАНЕЛИ        */
/* ============================================ */

.site-panel {
    margin-bottom: 0;
}

.routes-tabs {
    display: flex;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 0;
    gap: 5px; /* ← ДОБАВЛЕН ЗАЗОР 5px */
    padding: 5px 5px 5px 5px;
    margin: 0;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    position: sticky;
    top: 60px;
    z-index: 999;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.routes-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 16px 16px;
    border-radius: 6px; /* Маленькое закругление */
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.routes-tab i {
    font-size: 1.1rem;
}

.routes-tab.active {
    background: var(--accent-blue, #007aff);
    color: white;
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.2);
}

.routes-tab.active i {
    color: white;
}

.routes-tab:not(.active):hover {
    background: var(--bg-tertiary, #edf2f7);
    color: var(--text-primary, #1a2639);
}

/* Адаптивность для мобильных */
@media (max-width: 600px) {
    .routes-tabs {
        padding: 5px 5px 5px 5px;
        top: 56px;
    }
    
    .routes-tab {
        padding: 16px 16px;
        font-size: 0.9rem;
    }
    
    .routes-tab i {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .routes-tab span {
        display: none;
    }
    
    .routes-tab i {
        font-size: 1.2rem;
    }
    
    .routes-tabs {
        padding: 5px 5px 5px 5px;
    }
    
    .routes-tab {
        padding: 10px;
    }
}

/* ============================================ */
/* КНОПКА ИЗБРАННОГО - ИСПРАВЛЕННОЕ ПОЗИЦИОНИРОВАНИЕ */
/* ============================================ */

.route-card-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.favorite-btn {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: var(--text-secondary, #64748b);
    padding: 0;
    margin: 0;
    outline: none;
}

.favorite-btn i {
    font-size: 1.2rem;
    transition: all 0.2s ease;
    line-height: 1;
}

.favorite-btn.active {
    background: #fbbf24;
    border-color: #f59e0b;
    color: white;
}

.favorite-btn.active i {
    color: white;
}

.favorite-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.favorite-btn:hover i {
    transform: scale(1.1);
}

/* Темная тема */
[data-theme="dark"] .favorite-btn {
    background: #2d2d3e;
    border-color: #3d3d4e;
    color: #a0aec0;
}

[data-theme="dark"] .favorite-btn.active {
    background: #f59e0b;
    border-color: #fbbf24;
    color: #1e1e2e;
}

/* Исправление для карточки маршрута - не сдвигаем её влево */
.XyZwAbCdEfGhi {
    box-sizing: border-box;
    /* Убираем margin-right, так как кнопка позиционируется абсолютно */
}

/* Для мобильных устройств */
@media (max-width: 600px) {
    .favorite-btn {
        width: 40px;
        height: 40px;
        right: 12px;
    }
    
    .favorite-btn i {
        font-size: 1.1rem;
    }
}

/* Сообщение "Нет избранных маршрутов" */
.no-favorites-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-secondary, #64748b);
}

.no-favorites-message i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-favorites-message p {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.no-favorites-message .hint {
    font-size: 0.9rem;
    opacity: 0.7;
}


/* Стили для состояния загрузки при обновлении избранного */
.favorites-updating {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.favorites-updating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}