/* ========================================
   ENHANCED ROUTING STYLES
   ======================================== */

/* Inputs Wrapper for Swap Layout */
.inputs-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    padding-right: 40px;
    /* Make room for swap button */
}

/* Swap Button */
.swap-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
    transition: all 0.2s;
    z-index: 5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.swap-btn:hover {
    background: #f1f3f4;
    border-color: #4285F4;
    color: #4285F4;
}

/* Input Action Button (My Location) */
.input-action-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
    transition: all 0.2s;
}

.input-action-btn:hover {
    background: #f1f3f4;
    color: #4285F4;
}

.input-action-btn.loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: translateY(-50%) rotate(0deg);
    }

    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Route Preferences */
.route-preferences {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.preference-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #5f6368;
    cursor: pointer;
}

.preference-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4285F4;
    cursor: pointer;
}

/* Alternative Routes */
.alternative-routes {
    padding: 15px 20px;
}

.alternative-routes h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 12px 0;
}

.routes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.route-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.route-card:hover {
    border-color: #4285F4;
    background: rgba(66, 133, 244, 0.05);
}

.route-card.selected {
    border-color: #4285F4;
    background: rgba(66, 133, 244, 0.1);
}

.route-card-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.route-card-stats {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #5f6368;
}

.route-time {
    font-weight: 600;
    color: #4285F4;
}

/* Route Markers */
.route-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.origin-marker {
    background: #4285F4;
}

.dest-marker {
    background: #EA4335;
}

/* Instruction Step Improvements */
.instruction-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.instruction-step:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #4285F4;
}

.step-icon {
    width: 32px;
    height: 32px;
    background: #f1f3f4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-instruction {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 4px;
}

.step-distance {
    font-size: 12px;
    color: #5f6368;
}

/* Toast Notifications */
.routing-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: #323232;
    color: white;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.routing-toast.error {
    background: #EA4335;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 500px) {
    .swap-btn {
        right: -35px;
        width: 30px;
        height: 30px;
    }

    .route-preferences {
        flex-direction: column;
        gap: 8px;
    }
}

/* Preview Route Button */
.btn-preview-route {
    width: 100%;
    margin-top: 15px;
    padding: 10px;
    background: linear-gradient(135deg, #4285F4, #34A853);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-preview-route:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-preview-route.active {
    background: #EA4335;
}