/* ============================================
   Выбор типа расчета (Шаг 1)
   ============================================ */
.calculation-type-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calculation-type-option {
    display: block;
    padding: 16px;
    border: 2px solid #e5e5e7;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.calculation-type-option:hover {
    border-color: #0066ff;
    background: #f8f9ff;
}

.calculation-type-option.selected {
    border-color: #0066ff;
    background: #e8f1ff;
}

.calculation-type-option input[type="radio"] {
    display: none;
}

.option-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.option-icon {
    flex-shrink: 0;
}

.option-text {
    display: flex;
    flex-direction: column;
}

.option-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.option-desc {
    font-size: 13px;
    color: #86868b;
}

/* ============================================
   Выбор типа ТС
   ============================================ */
.vehicle-type-selector {
    display: grid;
    /*grid-template-columns: 1fr 1fr;*/
    gap: 12px;
    margin-bottom: 16px;
}

.vehicle-type {
    padding: 16px;
    border: 2px solid #e5e5e7;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.vehicle-type:hover {
    border-color: #0066ff;
    background: #f8f9ff;
}

.vehicle-type.selected {
    background: #e8f1ff;
    border-color: #0066ff;
}

.vehicle-type svg {
    margin-bottom: 8px;
}

.vehicle-type span {
    display: block;
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   Маршрут
   ============================================ */
.route-input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.route-field {
    width: 100%;
}

.route-field label {
    display: block;
    font-size: 13px;
    color: #86868b;
    margin-bottom: 6px;
}

.route-arrow-big {
    display: none;
    justify-content: center;
    padding: 8px 0;
}

/* Автозаполнение */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e5e7;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1001;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
}

.autocomplete-item:hover {
    background: #f5f5f7;
}

.autocomplete-item:last-child {
    border-radius: 0 0 10px 10px;
}

/* Карта */
.map-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 12px;
}

#map {
    height: 350px;
    width: 100%;
}

/* Информация о маршруте */
.route-info-card {
    margin-top: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f5f5f7 0%, #fafafa 100%);
    border-radius: 12px;
    border: 1px solid #e5e5e7;
}

.route-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.route-info-row:last-child {
    margin-bottom: 0;
}

.route-info-row.secondary {
    padding-top: 8px;
    border-top: 1px dashed #e5e5e7;
    font-size: 13px;
    color: #86868b;
}

.route-info-label {
    font-size: 14px;
    color: #666;
}

.route-info-value {
    font-size: 18px;
    font-weight: 700;
    color: #0066ff;
}

.route-info-row.secondary .route-info-value {
    font-size: 13px;
    font-weight: 500;
    color: #86868b;
}

/* Индикатор загрузки */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    color: #86868b;
    font-size: 14px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0066ff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Карточка результатов
   ============================================ */
.result-card {
    background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 24px;
    margin-top: 20px;
    border: 1px solid #e5e5e7;
    display: none;
    animation: slideUp 0.4s ease;
}

.result-card.show {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-title {
    font-size: 14px;
    color: #86868b;
    margin-bottom: 8px;
}

.result-amount {
    font-size: 32px;
    font-weight: 700;
    color: #0066ff;
    margin-bottom: 20px;
}

.result-breakdown {
    border-top: 1px solid #e5e5e7;
    padding-top: 16px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.breakdown-item:last-child {
    margin-bottom: 0;
    padding-top: 12px;
    border-top: 1px solid #e5e5e7;
    font-weight: 600;
    font-size: 16px;
}

/* Детали расчета */
.calculation-details {
    margin-top: 16px;
    padding: 16px;
    background: #f0f0f0;
    border-radius: 8px;
    font-size: 12px;
    color: #666;
}

.calculation-details h4 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}

.calculation-details p {
    margin-bottom: 4px;
    line-height: 1.6;
}

.calculation-details hr {
    border: none;
    border-top: 1px dashed #ccc;
    margin: 10px 0;
}

/* Кнопка WhatsApp */
.whatsapp-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: #25d366;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
}

.whatsapp-button:hover {
    background: #22c55e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Кнопка нового расчета */
.new-calc-button {
    width: 100%;
    padding: 14px;
    background: transparent;
    color: #0066ff;
    border: 2px solid #0066ff;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.new-calc-button:hover {
    background: #0066ff;
    color: white;
}

/* ============================================
   Нижняя навигация
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 420px;
    background: white;
    border-top: 1px solid #e5e5e7;
    padding: 8px 16px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    z-index: 100;
}

/* Кнопки Назад/Вперед - теперь часть формы */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-top: 30px;
    margin-bottom: 80px;
    background: white;
    gap: 12px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn {
    background: #f5f5f7;
    color: #666;
}

.back-btn:hover {
    background: #e5e5e7;
}

.next-btn {
    background: linear-gradient(135deg, #0051cc 0%, #0066ff 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 102, 255, 0.4);
}

.calc-btn {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
    flex: 1;
    justify-content: center;
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 199, 89, 0.4);
}

/* Иконки навигации */
.nav-icons {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding-top: 8px;
    border-top: 1px solid #e5e5e7;
}

.nav-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 16px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-icon-item svg {
    width: 24px;
    height: 24px;
    fill: #86868b;
}

.nav-icon-item span {
    font-size: 11px;
    color: #86868b;
}

.nav-icon-item.active svg {
    fill: #0066ff;
}

.nav-icon-item.active span {
    color: #0066ff;
}

/* ============================================
   Группы осей
   ============================================ */
#axle-groups-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.axle-group-card {
    background: #ffffff;
    border: 2px solid #e5e5e7;
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.axle-group-card:hover {
    border-color: #0066ff;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.1);
}

.axle-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e7;
}

.axle-group-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.delete-group-btn {
    background: transparent;
    border: none;
    color: #ff3b30;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.delete-group-btn:hover {
    background: #ffebee;
}

.distance-between-groups {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 12px 0;
    padding: 12px;
    background: #f5f5f7;
    border-radius: 10px;
}

.distance-arrow {
    font-size: 24px;
    color: #0066ff;
    margin-bottom: 8px;
}

.add-group-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #f5f5f7 0%, #fafafa 100%);
    border: 2px dashed #0066ff;
    border-radius: 12px;
    color: #0066ff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

.add-group-button:hover {
    background: #e8f1ff;
    border-color: #0051cc;
}

/* ============================================
   История
   ============================================ */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    padding: 16px;
    background: #f5f5f7;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #e8e8ed;
    transform: translateX(4px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-item-title {
    font-weight: 600;
    font-size: 15px;
    color: #1d1d1f;
}

.history-item-date {
    font-size: 12px;
    color: #86868b;
}

.history-item-details {
    font-size: 13px;
    color: #666;
}

.history-item-amount {
    font-weight: 600;
    color: #0066ff;
}

.history-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.secondary-button,
.danger-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-button {
    background: #f5f5f7;
    border: 1px solid #e5e5e7;
    color: #666;
}

.secondary-button:hover {
    background: #e5e5e7;
}

.danger-button {
    background: #fee;
    border: 1px solid #fcc;
    color: #c00;
}

.danger-button:hover {
    background: #fcc;
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: #86868b;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #666;
}

.empty-state p {
    font-size: 14px;
}

/* ============================================
   Подсказки
   ============================================ */
.hint {
    display: block;
    font-size: 12px;
    color: #86868b;
    margin-top: 6px;
}

.section-header {
    margin-bottom: 16px;
}

.section-description {
    font-size: 14px;
    color: #86868b;
    margin-top: 8px;
    line-height: 1.5;
}

/* ============================================
   Select стили
   ============================================ */
.config-select {
    font-size: 14px;
    padding: 14px 16px;
    cursor: pointer;
}

/* ============================================
   Ручной ввод расстояния
   ============================================ */
.manual-distance-section {
    margin-top: 16px;
    padding: 16px;
    background: #f0f8ff;
    border-radius: 12px;
    border: 1px dashed #0066ff;
}

.manual-hint {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    text-align: center;
}

/* ============================================
   Адаптивность
   ============================================ */
@media (max-width: 380px) {
    .nav-btn {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .result-amount {
        font-size: 28px;
    }
}

@media (min-width: 768px) {
    .bottom-nav {
        max-width: 480px;
    }
}
