/* Dark Intelligence Aesthetic - Palantir/Anduril inspired - Cold Mission-Critical Palette */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #0d1117;
    color: #e6f1ff;
}

/* Hide scrollbars globally while maintaining scroll functionality */
body, html {
    overflow: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

body::-webkit-scrollbar,
html::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* --- Navigation --- */
nav a {
    position: relative;
}

/* --- Alpha Badge - Tactical --- */
.alpha-badge {
    display: inline-block;
    background: transparent;
    color: #8b949e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 3px 10px;
    border-radius: 0;
    text-transform: uppercase;
    border: 1px solid #30363d;
    font-family: 'Courier New', monospace;
}

.alpha-badge-large {
    display: inline-block;
    background: #DC2626;
    color: #000000;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 3px;
    padding: 8px 20px;
    border-radius: 0;
    text-transform: uppercase;
    border: 2px solid #DC2626;
    font-family: 'Courier New', monospace;
    animation: pulse-alpha 2s ease-in-out infinite;
}

@keyframes pulse-alpha {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
    }
}

/* --- Map Container --- */
.map-container {
    height: calc(100vh - 64px); /* Full height minus nav height */
}

/* --- Layout adjustments for resizable sidebar --- */
#sidebar {
    width: 600px; /* Default wider sidebar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    background-color: #0a101f;
    border-right: 1px solid #30363d;
}

#sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Hide scrollbars on all elements */
* {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

*::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

#resizer {
    width: 5px;
    cursor: col-resize;
    background-color: #30363d;
    transition: background-color 0.2s ease-in-out;
}

#resizer:hover {
    background-color: #6AA8CC;
}

/* Leaflet map container needs explicit height */
#map {
    height: 100%;
    width: 100%;
    z-index: 10; /* Ensure map is below UI elements if they overlap */
    background-color: #0a101f;
}

/* Ensure better contrast for map tiles */
.leaflet-container {
    background-color: #0a101f;
}

/* --- Custom popup styling - Dark Intelligence with Glassmorphism --- */
.custom-popup .leaflet-popup-content-wrapper {
    background: rgba(13, 17, 23, 0.85);
    color: #e6f1ff;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(106, 168, 204, 0.15), 0 8px 32px rgba(0,0,0,0.6);
    padding: 0;
    border: 1px solid #30363d;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.custom-popup .leaflet-popup-content {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    max-width: 320px;
}

.custom-popup .leaflet-popup-tip {
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Popup container */
.custom-popup .popup-container {
    display: flex;
    flex-direction: column;
}

/* Header section */
.custom-popup .popup-header {
    background: rgba(10, 16, 31, 0.6);
    padding: 16px 18px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #6AA8CC;
}

.custom-popup .company-name {
    margin: 0 0 8px 0;
    font-size: 17px;
    font-weight: 800;
    color: #6AA8CC;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.custom-popup .risk-badge {
    display: inline-block;
    background-color: transparent;
    color: #6AA8CC;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 0;
    border: 1px solid #6AA8CC;
    font-family: 'Courier New', monospace;
}

/* Content sections */
.custom-popup .popup-section {
    padding: 14px 18px;
    border-bottom: 1px solid #374151;
}

.custom-popup .popup-section:last-of-type {
    border-bottom: none;
}

.custom-popup .section-title {
    margin: 0 0 8px 0;
    font-size: 11px;
    font-weight: 700;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'Courier New', monospace;
}

.custom-popup .company-description {
    margin: 0;
    font-size: 13px;
    color: #d1d5db;
    line-height: 1.6;
}

.custom-popup .risk-description {
    margin: 0;
    font-size: 14px;
    color: #e5e7eb;
    line-height: 1.6;
}

/* Footer with report link */
.custom-popup .popup-footer {
    padding: 14px 18px;
    background-color: rgba(10, 16, 31, 0.6);
    border-radius: 0 0 8px 8px;
    border-top: 1px solid #30363d;
}

.custom-popup .report-link {
    display: inline-flex;
    align-items: center;
    color: #6AA8CC;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.custom-popup .report-link:hover {
    color: #00ffff;
    transform: translateX(3px);
}

/* --- Logo Styling --- */
.logo-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 400;
    background-color: rgba(31, 41, 55, 0.9);
    padding: 5px 10px;
    border-radius: 0;
    border: 1px solid #4b5563;
}

.logo-container img {
    width: 120px;
    height: auto;
    display: block;
}

/* --- Autonomy Logo --- */
.autonomy-logo {
    background-color: #9ca3af;
    -webkit-mask-image: url('../assets/autonomy.svg');
    mask-image: url('../assets/autonomy.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    height: 150px;
    transition: background-color 0.3s ease;
}

.autonomy-logo:hover {
    background-color: #06b6d4; /* Cyan accent */
}

/* --- Autonomy Logo Footer --- */
.autonomy-logo-footer {
    background-color: #4b5563;
    -webkit-mask-image: url('../assets/autonomy.svg');
    mask-image: url('../assets/autonomy.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    height: 150px;
    width: 225px;
    margin: 0 auto;
    transition: background-color 0.3s ease;
}

.autonomy-logo-footer:hover {
    background-color: #fbbf24; /* Amber accent */
}

/* --- Custom Tactical Map Markers --- */
.custom-tactical-marker {
    background: transparent;
    border: none;
}

.marker-outer {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-inner {
    width: 12px;
    height: 12px;
    background: #6AA8CC;
    border: 2px solid #0a101f;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 8px rgba(106, 168, 204, 0.6);
}

.marker-pulse {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #6AA8CC;
    opacity: 0.4;
    animation: pulse-marker 2s ease-out infinite;
    z-index: 1;
}

@keyframes pulse-marker {
    0% {
        transform: scale(0.5);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* --- Highlighted Marker (Red) --- */
.marker-highlighted .marker-inner {
    background: #DC2626 !important;
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.8) !important;
}

.marker-highlighted .marker-pulse {
    background: #DC2626 !important;
}

/* --- Recent Headlines Section --- */
.headline-item {
    background-color: transparent;
    border-left: 2px solid #6AA8CC;
    border-bottom: 1px solid #30363d;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 13px;
    line-height: 1.4;
    color: #e6f1ff;
}

.headline-item:hover {
    background-color: rgba(106, 168, 204, 0.1);
    border-left-color: #6AA8CC;
    border-left-width: 3px;
    padding-left: 11px;
}

.headline-item.active {
    background-color: rgba(106, 168, 204, 0.15);
    border-left-color: #6AA8CC;
    border-left-width: 3px;
    color: #6AA8CC;
    padding-left: 11px;
}