/* Cluster Popup Enhancements */
.cluster-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cluster-popup .cluster-actions {
    display: flex;
    gap: 5px;
}

.btn-cluster-select-all {
    background: #3498db;
    border: none;
    color: white;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.btn-cluster-select-all:hover {
    background: #2980b9;
}

.cluster-popup-scrollable .popup-content {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.cluster-popup .shipment-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cluster-popup .shipment-time {
    font-size: 10px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 3px;
}

.cluster-popup .shipment-time.time-urgent {
    color: #e74c3c;
    font-weight: bold;
    animation: text-pulse 1.5s infinite;
}

@keyframes text-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.cluster-popup .shipment-time i {
    font-size: 9px;
}

/* Scrollbar styling for cluster popup */
.cluster-popup-scrollable .popup-content::-webkit-scrollbar {
    width: 6px;
}

.cluster-popup-scrollable .popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.cluster-popup-scrollable .popup-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.cluster-popup-scrollable .popup-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Popup time constraint styling */
.map-popup .info-row.time-constraint,
.leaflet-popup-content .map-popup .info-row.time-constraint {
    color: #e74c3c !important;
    font-weight: bold !important;
}

.map-popup .info-row.plan-date,
.leaflet-popup-content .map-popup .info-row.plan-date {
    color: #f39c12 !important;
    font-weight: 600 !important;
}

/* Hover tooltips for markers */
.leaflet-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
    font-weight: bold !important;
}

.leaflet-tooltip::before {
    border-top-color: rgba(0, 0, 0, 0.8) !important;
}

/* Unschedule button styles */
.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-cluster-unschedule {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-cluster-unschedule:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* Popup action buttons */
.popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn-mini {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-mini:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-mini i {
    font-size: 10px;
}

/* Scoped to the popup they belong to. Written bare, these three repainted every Bootstrap
   primary, warning and secondary button in the product: the map's blue turned up on the sign-in
   button, on Save, on every dialog, and the only reason the sign-in screen looked right was an
   inline colour with an !important on it fighting this rule back. Colours are the shared status
   palette, so the buttons in a popup are the same colours as everywhere else. */
.popup-actions .btn-primary {
    background: var(--color-primary);
    color: white;
}

.popup-actions .btn-warning {
    background: var(--status-warn);
    color: white;
}

.popup-actions .btn-secondary {
    background: var(--status-idle);
    color: white;
}

.btn-cluster-unschedule-single {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.btn-cluster-unschedule-single:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.btn-cluster-unschedule-single i {
    font-size: 9px;
}
