.s-module-selector {
    background: linear-gradient(135deg, #00233F 0%, #004080 100%);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: visible !important;
}

.s-module-dropdown {
    position: relative;
    overflow: visible !important;
}

.s-module-selector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    pointer-events: none;
}

.s-module-dropdown {
    position: relative;
    z-index: 2;
}

.s-module-dropdown-toggle {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.s-module-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-0.5px);
}

.s-module-dropdown-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 35, 63, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.s-module-icon {
    width: 16px;
    text-align: center;
    color: #00233F;
    font-size: 14px;
}

.s-module-name {
    flex: 1;
    text-align: left;
    font-weight: 500;
    color: #333;
    font-size: 13px;
}

.s-module-arrow {
    color: #888;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.s-module-dropdown-toggle[aria-expanded="true"] .s-module-arrow {
    transform: rotate(180deg);
}

.s-module-dropdown-menu {
    min-width: 100% !important;
    margin-top: 4px !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px);
    padding: 4px !important;
    max-height: 200px;
    overflow-y: auto;
    z-index: 9999 !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    transform: translateY(-8px) !important;
    opacity: 0 !important;
    transition: all 0.2s ease !important;
    pointer-events: none !important;
    display: block !important;
}

.s-module-dropdown-menu.show {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: all !important;
}

.s-module-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
}

.s-module-item:hover {
    background: linear-gradient(135deg, rgba(0, 35, 63, 0.08) 0%, rgba(0, 64, 128, 0.08) 100%);
    transform: translateX(2px);
}

.s-module-item.active {
    background: linear-gradient(135deg, #00233F 0%, #004080 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 35, 63, 0.3);
}

.s-module-item.active .s-module-item-icon,
.s-module-item.active .s-module-item-name {
    color: white;
}

.s-module-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.s-module-item.disabled:hover {
    background: none;
    transform: none;
}

.s-module-item-icon {
    width: 16px;
    text-align: center;
    color: #667eea;
    font-size: 13px;
}

.s-module-item-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    font-size: 12px;
}

.s-module-item-lock {
    color: #ff6b6b;
    font-size: 14px;
    margin-left: auto;
}

.s-module-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #888;
}

.s-module-loading .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Dark theme support */
[data-bs-theme="dark"] .s-module-dropdown-toggle {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

[data-bs-theme="dark"] .s-module-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

[data-bs-theme="dark"] .s-module-name {
    color: white;
}

[data-bs-theme="dark"] .s-module-dropdown-menu {
    background: rgba(30, 30, 30, 0.98);
}

[data-bs-theme="dark"] .s-module-item-name {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .s-module-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Cluster Marker Styles */
.cluster-marker-icon {
    transition: all 0.3s ease;
}

.cluster-marker-icon:hover .cluster-marker {
    transform: scale(1.1);
}

.cluster-popup .cluster-section {
    margin: 10px 0;
    border-top: 1px solid #eee;
    padding-top: 8px;
}

.cluster-popup .cluster-section:first-child {
    border-top: none;
    padding-top: 0;
}

.cluster-popup .cluster-section-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.cluster-popup .cluster-shipments {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cluster-popup .cluster-shipment-item {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.cluster-popup .cluster-shipment-item:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.cluster-popup .cluster-shipment-item.planned {
    background-color: #e3f2fd;
    border-color: #bbdefb;
}

.cluster-popup .cluster-shipment-item.planned:hover {
    background-color: #d1ecf1;
}

.cluster-popup .cluster-shipment-item.unplanned {
    background-color: #f5f5f5;
    border-color: #e0e0e0;
}

.cluster-popup .cluster-shipment-item.unplanned:hover {
    background-color: #eeeeee;
}

.cluster-popup .shipment-ref {
    font-weight: bold;
    font-size: 12px;
    color: #333;
}

.cluster-popup .shipment-vehicle {
    font-size: 11px;
    font-weight: 600;
}

.cluster-popup .shipment-type {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
}

.cluster-popup .btn-cluster-assign {
    background: #28a745;
    border: none;
    color: white;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cluster-popup .btn-cluster-assign:hover {
    background: #218838;
}

.cluster-popup-wrapper .leaflet-popup-content {
    margin: 8px 12px;
    width: auto !important;
}

.cluster-popup .popup-header .cluster-title {
    font-weight: bold;
    color: #333;
}

/* Marker animation for clusters */
@keyframes cluster-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cluster-marker-icon.mixed .cluster-marker {
    animation: cluster-pulse 2s infinite;
}

/* Time Window Indicators */
.time-indicator {
    position: absolute;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.9), -2px -2px 4px rgba(255,255,255,0.9), 2px -2px 4px rgba(255,255,255,0.9), -2px 2px 4px rgba(255,255,255,0.9);
    z-index: 10;
    line-height: 1;
}

.time-indicator.urgent {
    color: #e74c3c; /* Red color for time constraints */
}

.time-indicator.flexible {
    color: #2ecc71; /* Green color for flexible delivery dates */
}

.time-indicator.adr {
    color: #ff8c00; /* Orange color for ADR shipments */
}

.time-indicator-overlay {
    pointer-events: none;
    font-size: 16px !important;
    font-weight: 900 !important;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.9), -2px -2px 4px rgba(255,255,255,0.9), 2px -2px 4px rgba(255,255,255,0.9), -2px 2px 4px rgba(255,255,255,0.9) !important;
}

.time-indicator-overlay.urgent {
    color: #e74c3c !important;
}

.time-indicator-overlay.flexible {
    color: #2ecc71 !important;
}

.time-indicator-overlay.adr {
    color: #ff8c00 !important;
}

/* Pickup marker container styling */
.pickup-marker-container {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}



/* 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;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-secondary {
    background: #95a5a6;
    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;
} 