.ol-popup {
    position: absolute;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    bottom: 12px;
    left: -50px;
    min-width: 280px;
    max-width: 400px;
    z-index: 1001;
}

.ol-popup:after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -10px;
    border-width: 10px;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

.popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
}

.popup-close:hover {
    color: #000;
}

.popup-content h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #333;
}

.work-order-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.work-order-item {
    padding: 12px;
    margin-bottom: 8px;
    background: #f5f5f5;
    border-radius: 4px;
    transition: background 0.2s;
}

.work-order-item:hover {
    background: #e0e0e0;
}

.work-order-item strong {
    color: #333;
    font-size: 14px;
}

.work-order-item small {
    color: #666;
    font-size: 12px;
}

.work-order-map-container {
    width: 100%;
    height: calc(100vh - 250px);
    min-height: 600px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}

/* Ensure OpenLayers attribution control is visible */
.work-order-map-container .ol-attribution {
    display: block !important;
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 100;
    max-width: 80%;
}

.work-order-map-container .ol-attribution ul {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 11px;
}

.work-order-map-container .ol-attribution a {
    color: #0066cc;
    text-decoration: none;
}

.work-order-map-container .ol-attribution a:hover {
    text-decoration: underline;
}

/* Tooltip - Dynamic positioning above marker */
.map-tooltip {
    position: fixed;
    background-color: white;
    color: #333;
    padding: 0;
    border-radius: 8px;
    font-size: 13px;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 350px;
    max-height: 400px;
    overflow: hidden;
    line-height: 1.6;
    transform: translate(-50%, calc(-100% - 10px));
}

/* Arrow pointing down from the tooltip - with border for visibility */
.map-tooltip::after,
.map-tooltip::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
}

/* Outer arrow (border/shadow) */
.map-tooltip::before {
    bottom: -20px;
    border-top: 18px solid rgba(0, 0, 0, 0.2);
    z-index: -1;
}

/* Inner arrow (white) */
.map-tooltip::after {
    bottom: -16px;
    border-top: 16px solid white;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
}

/* Cluster tooltip styling */
.map-tooltip-cluster {
    padding: 20px;
    text-align: center;
    min-width: 220px;
}

.map-tooltip-cluster-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.map-tooltip-cluster-subtitle {
    font-size: 13px;
    color: #333;
    font-style: italic;
}

.map-tooltip-status-banner {
    background-color: #FF9800;
    color: white;
    padding: 8px 12px;
    font-weight: bold;
    font-size: 13px;
    text-align: center;
}

.map-tooltip-content {
    padding: 12px;
}

.map-tooltip-details {
    overflow-y: auto;
    max-height: 200px;
}

.map-tooltip-address {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.map-tooltip-installation {
    color: #666;
    font-size: 12px;
    margin-bottom: 8px;
}

.map-tooltip-installation strong {
    display: inline;
    font-weight: bold;
}

.map-tooltip-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 11px;
}

.map-tooltip-row-label {
    color: #666;
    font-weight: 500;
}

.map-tooltip-row-value {
    color: #333;
    text-align: right;
}

.map-tooltip-grid-company {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
    font-size: 12px;
    color: #666;
}

.map-tooltip strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
}

.map-tooltip small {
    font-size: 12px;
    display: inline;
    margin-right: 4px;
}

.map-tooltip .field-label {
    font-weight: bold;
    color: #666;
}

.map-tooltip .field-value {
    color: #333;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ol-popup {
        min-width: 240px;
        max-width: 90vw;
    }

    .work-order-map-container {
        border-radius: 0;
        height: calc(100vh - 200px);
        min-height: 400px;
    }
}
