/* AIS Vessel Tracker CSS */

/* Karten-Container */
#ais-vessel-map {
    position: relative;
    z-index: 1;
}

/* Zoom-Controls größer und besser sichtbar machen */
.leaflet-control-zoom {
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
}

.leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 20px !important;
    font-weight: bold !important;
}

.leaflet-control-zoom a:hover {
    background-color: #f4f4f4 !important;
}

/* Smooth Transitions für Marker bei Zoom */
.vessel-marker-icon {
    transition: all 0.3s ease !important;
}

/* Vessel Marker Icons */
.vessel-marker-icon {
    transition: all 0.3s ease;
}

.vessel-marker-icon:hover {
    filter: drop-shadow(0 0 8px rgba(52, 152, 219, 0.8));
    transform: scale(1.1);
}

/* Leaflet Icon Image Fix */
.leaflet-marker-icon img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

/* Stelle sicher, dass Icons sichtbar sind */
.leaflet-marker-icon {
    background: transparent !important;
    border: none !important;
}

/* Legacy Vessel Icon Styling (Fallback) */
.vessel-icon {
    background: transparent;
    border: none;
}

.vessel-icon div {
    font-size: 20px;
    color: #e74c3c;
    text-shadow: 
        -1px -1px 0 #fff,  
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        0 0 3px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    transform-origin: center center;
}

.vessel-icon:hover div {
    color: #c0392b;
    font-size: 24px;
    text-shadow: 
        -1px -1px 0 #fff,  
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        0 0 5px rgba(231, 76, 60, 0.8);
}

/* Popup Styling */
.vessel-popup {
    min-width: 250px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.vessel-popup h3 {
    margin: 0 0 10px 0;
    padding: 0 0 8px 0;
    border-bottom: 2px solid #3498db;
    color: #2c3e50;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vessel-popup h3 img {
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.vessel-popup table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.vessel-popup table tr {
    border-bottom: 1px solid #ecf0f1;
}

.vessel-popup table tr:last-child {
    border-bottom: none;
}

.vessel-popup table td {
    padding: 4px 8px;
    vertical-align: top;
}

.vessel-popup table td:first-child {
    color: #7f8c8d;
    width: 40%;
}

.vessel-popup table td:last-child {
    color: #2c3e50;
    font-weight: 500;
}

/* Marker Cluster Styling */
.marker-cluster-small {
    background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-small div {
    background-color: rgba(110, 204, 57, 0.8);
}

.marker-cluster-medium {
    background-color: rgba(241, 196, 15, 0.6);
}

.marker-cluster-medium div {
    background-color: rgba(241, 196, 15, 0.8);
}

.marker-cluster-large {
    background-color: rgba(231, 76, 60, 0.6);
}

.marker-cluster-large div {
    background-color: rgba(231, 76, 60, 0.8);
}

.marker-cluster {
    background-clip: padding-box;
    border-radius: 20px;
}

.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 15px;
    font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
    font-weight: bold;
}

.marker-cluster span {
    line-height: 30px;
    color: white;
}

/* Info-Box Styling */
#ais-vessel-info {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#ais-vessel-details {
    margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .vessel-popup {
        min-width: 200px;
    }
    
    .vessel-popup h3 {
        font-size: 14px;
    }
    
    .vessel-popup table {
        font-size: 12px;
    }
    
    .vessel-popup table td {
        padding: 3px 5px;
    }
}

/* Loading Spinner */
.ais-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.ais-loading::after {
    content: "";
    display: block;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Leaflet Control Styling (für bessere Integration) */
.leaflet-control-zoom a {
    background-color: #fff;
    color: #333;
}

.leaflet-control-zoom a:hover {
    background-color: #f4f4f4;
}

/* Custom Attribution */
.leaflet-control-attribution {
    font-size: 11px;
    background-color: rgba(255, 255, 255, 0.8);
}

.leaflet-control-attribution a {
    color: #0078A8;
}
