:root {
    --bg-dark: #090b0f;
    --glass-bg: rgba(14, 18, 25, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    
    /* Neon Accents */
    --red-heat: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.3);
    
    --yellow-alert: #eab308;
    --yellow-glow: rgba(234, 179, 8, 0.3);
    
    --blue-ghost: #3b82f6;
    --blue-glow: rgba(59, 130, 246, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden; /* Desktop lock */
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    flex-direction: row;
}

.map-container {
    flex-grow: 1;
    height: 100%;
}

.sidebar {
    width: 400px;
    background: var(--glass-bg);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-header h1 {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.sidebar-header h2 {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-secondary);
    margin-top: 4px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #10b981;
    margin-top: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blinking {
    animation: blinker 1.5s linear infinite;
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

@keyframes blinker {
    50% { opacity: 0.3; }
}

.feed-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feed-container::-webkit-scrollbar {
    width: 6px;
}
.feed-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.intel-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, background 0.2s;
    cursor: pointer;
}

.intel-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.intel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.intel-card.red_heat::before { background: var(--red-heat); box-shadow: 0 0 12px var(--red-glow); }
.intel-card.yellow_alert::before { background: var(--yellow-alert); box-shadow: 0 0 12px var(--yellow-glow); }
.intel-card.blue_ghost::before { background: var(--blue-ghost); box-shadow: 0 0 12px var(--blue-glow); }

.intel-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #fff;
}

.intel-card p {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.intel-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
}

/* Google Maps Overrides */
.gm-style-iw-c {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
    border-radius: 8px !important;
    padding: 0 !important;
}
.gm-style .gm-style-iw-tc::after {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
}
.gm-ui-hover-effect {
    filter: invert(1); /* makes the close X white */
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .map-container {
        height: 60vh;
        flex-grow: 0;
    }
    .sidebar {
        width: 100%;
        height: 40vh;
        border-left: none;
        border-top: 1px solid var(--glass-border);
        box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
    }
}

.map-legend {
    position: absolute;
    bottom: 30px;
    left: 20px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    color: white;
    z-index: 1000;
    max-width: 250px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.map-legend.collapsed .legend-content {
    max-height: 0;
    opacity: 0;
    padding: 0;
}

.map-legend.collapsed .legend-chevron {
    transform: rotate(180deg);
}

.legend-header {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.2);
    user-select: none;
}

.legend-chevron {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.legend-content {
    max-height: 500px;
    opacity: 1;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #cbd5e1;
}

.legend-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 16px;
    line-height: 14px;
    text-align: center;
}
