/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(145deg, #0A0F1B, #142036);
    color: #E5E7EB;
    font-family: 'IBM Plex Mono', monospace;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header Bar */
#header-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 60px;
    background: linear-gradient(to right, rgba(0, 255, 255, 0.2), rgba(10, 20, 40, 0));
    display: flex;
    align-items: center;
    padding-left: 1rem;
    z-index: 900;
}

.header-title {
    color: #00FFFF;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 0 0.5rem rgba(0, 255, 255, 0.8);
    animation: glow 2s infinite;
}

@keyframes glow {
    0% { text-shadow: 0 0 0.3rem rgba(0, 255, 255, 0.6); }
    50% { text-shadow: 0 0 0.7rem rgba(0, 255, 255, 1); }
    100% { text-shadow: 0 0 0.3rem rgba(0, 255, 255, 0.6); }
}

/* Map */
#map {
    flex: 1;
    z-index: 1;
    background: transparent;
    border-radius: 0.5rem;
    margin: 1rem;
    margin-top: 70px;
    box-shadow: 0 0 1rem rgba(0, 255, 255, 0.2);
}

/* Sidebar */
.sidebar {
    position: absolute;
    top: 70px;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1000;
    width: 250px;
}

/* Panel */
.panel {
    background: rgba(10, 20, 40, 0.95);
    border: 2px solid #00FFFF;
    border-radius: 0.5rem;
    box-shadow: 0 0 1rem rgba(0, 255, 255, 0.3);
}

/* Panel Header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #00FFFF;
}

.panel-header h3 {
    color: #00FFFF;
    font-size: 1rem;
    font-weight: 500;
}

.toggle-btn {
    background: none;
    border: none;
    color: #FACC15;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.5rem;
    transition: color 0.3s;
}

.toggle-btn:hover {
    color: #FFFFFF;
}

/* Panel Content */
.panel-content {
    padding: 1rem;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.panel-content.show {
    max-height: 500px;
    opacity: 1;
}

.panel-content.hidden {
    max-height: 0;
    opacity: 0;
    padding: 0 1rem;
}

/* Info Panel Content */
.info-content .info-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.info-content .info-item span:first-child {
    color: #00FFFF;
    font-weight: 500;
}

.info-content .info-item span:last-child {
    color: #FACC15;
}

.info-content .info-item span.new {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Countries Panel Content */
.countries-content .country-entry {
    color: #00FFFF;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Top IPs Panel Content */
.top-ips-content .ip-entry {
    color: #00FFFF;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* MITRE Techniques Panel Content */
.mitre-techniques-content {
    max-height: 90px; /* Height for 3 items (3 * ~30px per item) */
    overflow-y: auto;
    border: 1px solid #00FFFF; /* Box border */
    border-radius: 0.25rem;
    background: rgba(20, 40, 80, 0.5); /* Box background */
    padding: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: #00FFFF rgba(10, 20, 40, 0.95);
}

.mitre-techniques-content .technique-entry {
    color: #00FFFF;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: block;
    line-height: 1.2;
}

/* Custom Scrollbar */
.mitre-techniques-content::-webkit-scrollbar {
    width: 8px;
}

.mitre-techniques-content::-webkit-scrollbar-track {
    background: rgba(10, 20, 40, 0.95);
    border-radius: 4px;
}

.mitre-techniques-content::-webkit-scrollbar-thumb {
    background: #00FFFF;
    border-radius: 4px;
}

.mitre-techniques-content::-webkit-scrollbar-thumb:hover {
    background: #FACC15;
}

/* Attack List Ticker */
#attack-list {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: rgba(10, 20, 40, 0.95);
    border-top: 2px solid #00FFFF;
    overflow: hidden;
    font-family: 'IBM Plex Mono', monospace;
    color: #E5E7EB;
    z-index: 1000;
}

.attack-item {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    padding: 0.5rem 1rem;
    height: 60px;
    border-bottom: 1px dashed #00FFFF;
    align-items: center;
}

.attack-item-field {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    text-align: center;
}

.attack-item-label {
    color: #00FFFF;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.attack-item-value {
    color: #E5E7EB;
    word-break: break-word;
}

.attack-item-value.mitre {
    color: #FACC15;
}

/* Ransomlook Ticker */
#news-ticker {
    position: fixed;
    bottom: 120px;
    left: 0;
    width: 100%;
    height: 40px;
    background: rgba(20, 40, 80, 0.95);
    border-top: 2px solid #FACC15;
    border-bottom: 2px solid #FACC15;
    overflow: hidden;
    z-index: 900;
}

#news-ticker-content {
    display: inline-block;
    white-space: nowrap;
}

.news-ticker-content-wrapper {
    display: flex;
}

.news-item {
    display: inline-block;
    padding: 0 2rem;
    line-height: 40px;
    font-size: 0.9rem;
    color: #00FFFF;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* NAUSS Marker */
.nauss-marker {
    width: 18px;
    height: 18px;
    background: radial-gradient(circle, #00FF00 20%, #00FF00 60%, transparent 70%);
    border-radius: 50%;
    animation: pulseNauss 2s infinite;
}

@keyframes pulseNauss {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Attack Label */
.attack-label {
    color: #00FFFF;
    font-size: 0.75rem;
    text-shadow: 0 0 0.5rem rgba(0, 255, 255, 0.8);
    background: rgba(10, 20, 40, 0.7);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Leaflet Tooltip */
.leaflet-tooltip.country-tooltip {
    background: rgba(10, 20, 40, 0.95);
    border: 1px solid #00FFFF;
    color: #E5E7EB;
    font-size: 0.75rem;
    box-shadow: 0 0 0.5rem rgba(0, 255, 255, 0.3);
}

/* Leaflet Popup */
.leaflet-popup-content-wrapper {
    background: rgba(10, 20, 40, 0.95);
    border: 2px solid #00FFFF;
    color: #E5E7EB;
    box-shadow: 0 0 0.5rem rgba(0, 255, 255, 0.3);
}

.leaflet-popup-content-wrapper .leaflet-popup-content {
    font-size: 0.875rem;
}

.leaflet-popup-content-wrapper h4 {
    color: #00FFFF;
    margin-bottom: 0.5rem;
}

.leaflet-popup-content-wrapper ul {
    list-style: none;
    padding: 0;
}

.leaflet-popup-content-wrapper ul li {
    margin-bottom: 0.25rem;
}

.leaflet-popup-content-wrapper ul li a {
    color: #FACC15;
    text-decoration: none;
}

.leaflet-popup-content-wrapper ul li a:hover {
    text-decoration: underline;
}

/* Attack Count Tooltip */
.leaflet-tooltip.attack-count-tooltip {
    background: rgba(10, 20, 40, 0.95);
    border: 1px solid #00FFFF;
    color: #E5E7EB;
    font-size: 0.75rem;
    box-shadow: 0 0 0.5rem rgba(0, 255, 255, 0.3);
}

.leaflet-tooltip.attack-count-tooltip h4 {
    color: #00FFFF;
    margin-bottom: 0.25rem;
}

.leaflet-tooltip.attack-count-tooltip .attack-count {
    color: #FACC15;
    font-weight: 500;
}

/* Cluster Icon */
.cluster-icon {
    background: rgba(10, 20, 40, 0.95);
    border: 2px solid #00FFFF;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FACC15;
    font-size: 1rem;
    box-shadow: 0 0 0.5rem rgba(0, 255, 255, 0.3);
}

/* Modal Styling */
#ip-details-modal {
    font-family: 'IBM Plex Mono', monospace;
}

#close-modal:hover {
    color: #FACC15;
}

/* Media Queries */
@media (max-width: 768px) {
    #map {
        margin: 0.5rem;
        margin-top: 60px;
    }
    #header-bar {
        height: 50px;
    }
    .header-title {
        font-size: 1.2rem;
    }
    .sidebar {
        top: 60px;
        right: 0.5rem;
        width: 200px;
    }
    .panel-header h3 {
        font-size: 0.875rem;
    }
    .panel-content {
        font-size: 0.75rem;
    }
    .mitre-techniques-content {
        max-height: 72px;
    }
    #attack-list {
        height: 100px;
    }
    .attack-item {
        height: 50px;
        font-size: 0.75rem;
    }
    #news-ticker {
        bottom: 100px;
        height: 30px;
    }
    .news-item {
        line-height: 30px;
        font-size: 0.75rem;
    }
}