/* =============================================================
   РЕЗУЛЬТАТЫ ПОИСКА: КАРТОЧКИ ГРУЗОВ
   Двухколоночная сетка приоритетов, карточка груза, кружки-метрики,
   слоты погрузки и панель минорных ошибок маршрутизации.
   ============================================================= */

/* -------------------------------------------------------------
   1. СЕТКА КОЛОНОК ПРИОРИТЕТОВ
   ------------------------------------------------------------- */

/* Двухколоночная сетка результатов с адаптивным переносом */
.results-columns-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
    width: 100%;
    margin-top: 16px;
    align-items: start;
}

/* Колонки приоритетов */
.priority-column {
    background-color: #292a2d;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    min-height: 200px;
}
.high-priority-zone {
    border: 2px solid #81c995;
}
.medium-priority-zone {
    border: 2px solid #fdd663;
}
.column-header {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.high-priority-zone .column-header { color: #81c995; }
.medium-priority-zone .column-header { color: #fdd663; }

.cards-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* -------------------------------------------------------------
   2. КАРТОЧКА ГРУЗА
   ------------------------------------------------------------- */

/* Карточка отдельного груза (position: relative для слотов и номера) */
.cargo-card {
    background-color: #202124;
    border-radius: 10px;
    padding: 24px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Подсветка рамки в зависимости от тарифа */
.high-tariff-border {
    border: 2px solid #c5a3ff !important;
    box-shadow: 0 0 12px rgba(197, 163, 255, 0.2);
}
.normal-tariff-border {
    border: 2px solid #ffffff !important;
}

/* Номер карточки в левом верхнем углу */
.card-number {
    position: absolute;
    top: 14px;
    left: 16px;
    font-size: 30px;
    font-weight: bold;
    color: #9aa0a6;
    letter-spacing: 0.5px;
}

/* -------------------------------------------------------------
   3. МАРШРУТ (АДРЕСА ПОГРУЗКИ/РАЗГРУЗКИ)
   ------------------------------------------------------------- */

/* Контейнер маршрута: левый адрес → стрелка → правый адрес */
.route-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 20px;
    gap: 15px;
}
.address-table {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: #292a2d;
    padding: 18px;
    min-height: 140px;
    border-radius: 6px;
    border: 2px solid #ffffff !important;
}
.address-table .cluster {
    font-size: 18px;
    font-weight: bold;
    color: #8ab4f8;
    margin-bottom: 6px;
}
.address-table .point {
    font-size: 15px;
    font-weight: 500;
    color: #e8eaed;
    margin-bottom: 8px;
}
.address-table .full-address {
    font-size: 12px;
    color: #9aa0a6;
    line-height: 1.4;
}
.route-arrow {
    font-size: 48px;
    color: #8ab4f8;
    padding: 0 10px;
    user-select: none;
}

/* -------------------------------------------------------------
   4. КРУЖКИ-МЕТРИКИ (цена, сумма, дистанции, время)
   ------------------------------------------------------------- */

/* Ряд двух верхних кружков (цена за км и сумма груза) */
.top-metrics-row {
    display: flex;
    justify-content: center;
    gap: 48px;
    width: 100%;
    margin-top: 10px;
}

/* Общие стили для всех кружков */
.circle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.circle-value {
    background-color: #303134;
    color: #e8eaed;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.circle-label {
    font-size: 11px;
    color: #9aa0a6;
    margin-top: 6px;
    max-width: 120px;
    line-height: 1.2;
}

/* Верхний кружок «Цена за км» (128px), цвет зависит от приоритета */
.top-price-circle .circle-value {
    width: 128px;
    height: 128px;
    font-size: 16px;
    border: 2px solid #5f6368;
}
.high-priority-zone .top-price-circle .circle-value {
    border-color: #81c995;
    color: #81c995;
}
.medium-priority-zone .top-price-circle .circle-value {
    border-color: #fdd663;
    color: #fdd663;
}

/* Верхний кружок «Сумма груза» (128px) */
.total-price-circle .circle-value {
    width: 128px;
    height: 128px;
    font-size: 16px;
    border: 2px solid #ff8bcb;
    color: #ff8bcb;
}

/* Нижний ряд из 4 кружков (дистанции и время) */
.bottom-metrics-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.metrics-single-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    gap: 8px;
}
.metric-circle .circle-value {
    width: 94px;
    height: 94px;
    border: 2px solid #ffffff !important;
}
.metric-circle .circle-label {
    max-width: 110px;
}
/* Кружки с километрами — крупнее шрифт */
.metric-km-circle .circle-value {
    font-size: 18px;
}
/* Кружки времени — стандартный шрифт */
.metric-time-circle .circle-value {
    font-size: 13px;
}

/* -------------------------------------------------------------
   5. СЛОТЫ ПОГРУЗКИ (бейджи в правом верхнем углу карточки)
   ------------------------------------------------------------- */

/* Контейнер слотов в правом верхнем углу карточки */
.loading-slots-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 10;
}

/* Квадратный бейдж слота с синей неоновой подсветкой */
.slot-badge {
    background-color: rgba(0, 123, 255, 0.08);
    border: 1px solid #0056b3;
    color: #00bcd4;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace, sans-serif;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 0 8px rgba(0, 188, 212, 0.3);
}

/* Кнопка-переключатель «Ещё +N записей» */
.slot-badge.slot-more {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px dashed #555;
    color: #aaa;
    box-shadow: none;
}
/* Стиль кнопки в раскрытом состоянии («Скрыть») */
.slot-badge.slot-more.slot-expanded {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
    color: #ff6b6b;
}

/* Скрытый блок дополнительных слотов */
.slots-hidden {
    display: none;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 6px;
}
.slots-hidden.is-visible {
    display: flex;
    animation: fadeInSlots 0.2s ease-out;
}

/* Анимация плавного появления скрытых слотов */
@keyframes fadeInSlots {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -------------------------------------------------------------
   6. ПАНЕЛЬ МИНОРНЫХ ОШИБОК МАРШРУТИЗАЦИИ
   ------------------------------------------------------------- */

.minor-errors-box {
    background-color: #3c2626;
    border: 2px solid #f28b82;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.minor-errors-title {
    font-size: 15px;
    font-weight: bold;
    color: #f28b82;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.minor-errors-list {
    list-style-type: none;
    padding-left: 0;
}
.minor-errors-list li {
    font-size: 13px;
    color: #e8eaed;
    margin-bottom: 6px;
    line-height: 1.4;
}
.minor-errors-list li:last-child {
    margin-bottom: 0;
}
.error-route-key {
    font-family: 'Courier New', Courier, monospace;
    background-color: #202124;
    padding: 2px 6px;
    border-radius: 4px;
    color: #ffaa9f;
    margin-right: 6px;
}
