/**
 * Project Heimdall - Main Stylesheet
 */

/* Navbar Logo */
.navbar-logo {
    padding: 0 !important;
    margin: 0 !important;
    height: 3.25rem;
    display: flex;
    align-items: center;
}

.navbar-logo img {
    height: 3.25rem !important;
    width: auto;
    max-height: none !important;
    object-fit: contain;
    aspect-ratio: 1 / 1;
}

/* Vessel Markers */
.vessel-marker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

/* Vessel name / call-sign label */
.vessel-label {
    position: absolute;
    left: 50%;
    top: 50%;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
    line-height: 1.3;
    /* placement transform is set inline by JS */
}

.vessel-label-name {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    text-shadow:
        -1px -1px 0 rgba(0, 0, 0, 0.85),
         1px -1px 0 rgba(0, 0, 0, 0.85),
        -1px  1px 0 rgba(0, 0, 0, 0.85),
         1px  1px 0 rgba(0, 0, 0, 0.85),
         0    2px 4px rgba(0, 0, 0, 0.6);
}

.vessel-label-callsign {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    text-shadow:
        -1px -1px 0 rgba(0, 0, 0, 0.85),
         1px -1px 0 rgba(0, 0, 0, 0.85),
        -1px  1px 0 rgba(0, 0, 0, 0.85),
         1px  1px 0 rgba(0, 0, 0, 0.85),
         0    2px 4px rgba(0, 0, 0, 0.6);
    opacity: 1;
}

.vessel-marker svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.vessel-marker:hover svg {
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
}

/* Critical threat pulse animation */
.vessel-marker.critical svg path {
    animation: pulse-critical 1.5s ease-in-out infinite;
}

@keyframes pulse-critical {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

/* High threat subtle pulse */
.vessel-marker.high svg path {
    animation: pulse-high 2s ease-in-out infinite;
}

@keyframes pulse-high {
    0%, 100% {
        opacity: 0.9;
    }
    50% {
        opacity: 1;
    }
}

/* Map popup customization */
.mapboxgl-popup-content {
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    max-width: 300px;
}

.mapboxgl-popup-content strong {
    color: #363636;
}

/* Ensure text wraps properly in popups */
.mapboxgl-popup-content div {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.mapboxgl-popup-close-button {
    position: absolute !important;
    top: -12px !important;
    right: -12px !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    line-height: 1 !important;
    transition: transform 0.1s ease, background-color 0.2s ease !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background-color: #f14668 !important;
    border: 2px solid white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.mapboxgl-popup-close-button .icon {
    color: white !important;
}

.mapboxgl-popup-close-button .icon i {
    color: white !important;
}

.mapboxgl-popup-close-button:hover {
    transform: scale(1.1) !important;
    background-color: #e02552 !important;
}

/* Map controls */
.mapboxgl-ctrl-group {
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mapboxgl-ctrl-group button {
    width: 32px;
    height: 32px;
}

/* Info panel scrollbar */
.info-panel::-webkit-scrollbar {
    width: 8px;
}

.info-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.info-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.info-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Smooth transitions */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Status indicators */
.status-item {
    transition: background-color 0.2s ease;
}

.status-item:hover {
    background-color: #f5f5f5;
    border-radius: 4px;
    padding-left: 4px;
}

/* Vessel info display */
.vessel-info {
    font-size: 0.9rem;
    line-height: 1.6;
}

.vessel-info strong {
    display: inline-block;
    min-width: 80px;
}

/* Alert styling (for future Phase 9) */
.alert-container {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    max-width: 500px;
}

/* Threat level badges */
.threat-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.threat-badge.negligible {
    background-color: #00d1b2;
    color: white;
}

.threat-badge.low {
    background-color: #48c774;
    color: white;
}

.threat-badge.medium {
    background-color: #ffdd57;
    color: #363636;
}

.threat-badge.high {
    background-color: #ff9f40;
    color: white;
}

.threat-badge.critical {
    background-color: #f14668;
    color: white;
    animation: pulse-badge 1s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}
