/* ========================================
   Route Builder Styles
   Google Maps-style route planning
   ======================================== */

/* Route Builder Panel */
.route-builder-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rb-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rb-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.rb-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
}

.rb-close:hover {
    background: rgba(255,255,255,0.3);
}

.rb-info {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    padding: 10px 12px;
    font-size: 12px;
    color: #1e40af;
}

/* Transport Selector */
.rb-transport-selector {
    padding: 12px;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.rb-transport-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.rb-transport-option {
    cursor: pointer;
}

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

.rb-transport-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
    transition: all 0.2s;
}

.rb-transport-option input:checked + .rb-transport-card {
    border-color: #3b82f6;
    background: #dbeafe;
}

.rb-transport-card:hover {
    border-color: #3b82f6;
}

.rb-transport-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.rb-transport-label {
    font-weight: 600;
    font-size: 11px;
    color: #1f2937;
}

.rb-stops {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    max-height: 400px;
}

.rb-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 13px;
}

.rb-stop {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: move;
    transition: all 0.2s;
}

.rb-stop:hover {
    background: #f3f4f6;
    border-color: #3b82f6;
}

.rb-stop-handle {
    color: #9ca3af;
    font-size: 16px;
    cursor: move;
}

.rb-stop-number {
    background: #3b82f6;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.rb-stop-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rb-stop-icon {
    font-size: 18px;
}

.rb-stop-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

.rb-stop-remove {
    background: #ef4444;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.rb-stop-remove:hover {
    background: #dc2626;
}

/* Stats */
.rb-stats {
    display: flex;
    justify-content: space-around;
    padding: 16px;
    background: #f0f9ff;
    border-top: 2px solid #e0f2fe;
}

.rb-stat {
    text-align: center;
}

.rb-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #3b82f6;
}

.rb-stat-label {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

/* Actions */
.rb-actions {
    padding: 12px;
    border-top: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rb-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.rb-btn-primary {
    background: #3b82f6;
    color: white;
}

.rb-btn-primary:hover {
    background: #2563eb;
}

.rb-btn-success {
    background: #10b981;
    color: white;
}

.rb-btn-success:hover {
    background: #059669;
}

.rb-btn-danger {
    background: #6b7280;
    color: white;
}

.rb-btn-danger:hover {
    background: #4b5563;
}

/* Navigation UI */
.rb-navigation {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 20px;
    z-index: 2000;
    min-width: 380px;
    max-width: 90vw;
}

.rb-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.rb-nav-progress {
    background: #3b82f6;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.rb-progress-bar {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.rb-progress-fill {
    background: linear-gradient(90deg, #3b82f6, #10b981);
    height: 100%;
    transition: width 0.3s ease;
}

.rb-nav-current {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f0f9ff;
    border-radius: 12px;
    margin-bottom: 16px;
}

.rb-nav-icon {
    font-size: 48px;
}

.rb-nav-info {
    flex: 1;
}

.rb-nav-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rb-nav-name {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 4px 0;
}

.rb-nav-distance {
    font-size: 24px;
    font-weight: 700;
    color: #3b82f6;
}

.rb-nav-actions {
    display: flex;
    gap: 8px;
}

.rb-nav-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    background: #e5e7eb;
    color: #1f2937;
    transition: all 0.2s;
}

.rb-nav-btn:hover {
    background: #d1d5db;
}

.rb-nav-btn-primary {
    background: #3b82f6;
    color: white;
}

.rb-nav-btn-primary:hover {
    background: #2563eb;
}

.rb-nav-btn-success {
    background: #10b981;
    color: white;
}

.rb-nav-btn-success:hover {
    background: #059669;
}

.rb-nav-btn-danger {
    background: #ef4444;
    color: white;
}

.rb-nav-btn-danger:hover {
    background: #dc2626;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .route-builder-panel {
        right: 10px;
        width: calc(100vw - 20px);
        max-width: 340px;
        bottom: 10px;
        max-height: 60vh; /* Compacter op mobiel */
        border-radius: 12px; /* Kleinere radius */
    }
    
    .rb-header {
        padding: 12px 16px; /* Compacter */
        font-size: 16px;
    }
    
    .rb-header h3 {
        font-size: 16px; /* Kleiner */
    }
    
    .rb-info {
        padding: 8px 10px; /* Compacter */
        font-size: 11px;
    }
    
    .rb-transport-selector {
        padding: 10px; /* Compacter */
    }
    
    .rb-stops {
        padding: 8px; /* Compacter */
        max-height: 25vh; /* Beperk hoogte */
    }
    
    .rb-stop {
        padding: 8px; /* Compacter */
        font-size: 13px;
    }
    
    .rb-stop-number {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    .rb-stop-info {
        gap: 4px;
    }
    
    .rb-stop-name {
        font-size: 13px;
    }
    
    .rb-stop-meta {
        font-size: 10px;
    }
    
    .rb-stats {
        padding: 10px; /* Compacter */
    }
    
    .rb-stat-value {
        font-size: 18px; /* Kleiner */
    }
    
    .rb-stat-label {
        font-size: 10px;
    }
    
    .rb-actions button {
        padding: 10px; /* Compacter */
        font-size: 13px;
    }
    
    .rb-navigation {
        width: calc(100vw - 40px);
        min-width: 0;
        bottom: 10px;
        left: 20px;
        transform: none;
        padding: 12px; /* Compacter */
    }
    
    .rb-nav-header {
        font-size: 14px;
    }
    
    .rb-nav-distance {
        font-size: 20px; /* Kleiner */
    }
}

/* Add to Route Button in Popups */
.add-to-route-btn {
    width: 100%;
    padding: 10px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    font-size: 13px;
    transition: all 0.2s;
}

.add-to-route-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Scrollbar styling */
.rb-stops::-webkit-scrollbar {
    width: 8px;
}

.rb-stops::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.rb-stops::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

.rb-stops::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}