:root {
  --bg-dark: #000408;
  --bg-panel: rgba(5, 15, 25, 0.9);
  --border-cyan: #00ffff;
  --border-red: #ff0044;
  --text-cyan: #00ffff;
  --text-red: #ff0044;
  --text-green: #00ff00;
  --text-yellow: #ffff00;
  --text-white: #ffffff;
  --text-gray: #6b8096;
  --glow-cyan: rgba(0, 255, 255, 0.6);
  --glow-red: rgba(255, 0, 68, 0.8);
  --font-tech: 'Orbitron', sans-serif;
  --font-data: 'Rajdhani', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-data);
  background: var(--bg-dark);
  color: var(--text-cyan);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Background Grid */
.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border-cyan) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-cyan) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

/* Header */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(0, 20, 40, 0.95);
  border-bottom: 2px solid var(--border-cyan);
  box-shadow: 0 0 20px var(--glow-cyan);
  position: relative;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 1.5rem;
  color: var(--text-red);
  animation: rotate 4s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.logo-text {
  font-family: var(--font-tech);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-shadow: 0 0 10px var(--glow-cyan);
}

.threat-level {
  display: flex;
  align-items: center;
  gap: 10px;
}

.level-label {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.level-value {
  font-family: var(--font-tech);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-red);
  text-shadow: 0 0 15px var(--glow-red);
}

.header-right {
  display: flex;
  gap: 10px;
}

.ctrl-btn {
  padding: 8px 15px;
  background: rgba(0, 136, 255, 0.1);
  border: 1px solid var(--border-cyan);
  color: var(--text-cyan);
  font-family: var(--font-tech);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 3px;
}

.ctrl-btn:hover {
  background: rgba(0, 136, 255, 0.3);
  box-shadow: 0 0 15px var(--glow-cyan);
  transform: translateY(-2px);
}

/* Main Container */
.main-container {
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  height: calc(100vh - 120px);
  gap: 10px;
  padding: 10px;
  position: relative;
  z-index: 1;
}

/* Side Panels */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.panel-section {
  background: var(--bg-panel);
  border: 1px solid var(--border-cyan);
  border-radius: 5px;
  padding: 15px;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.3);
}

.header-icon {
  font-size: 1.2rem;
  color: var(--text-cyan);
  text-shadow: 0 0 10px var(--glow-cyan);
}

.section-header h3 {
  font-family: var(--font-tech);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-cyan);
}

/* Statistics */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-item {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-cyan);
  border-radius: 3px;
  padding: 10px;
  text-align: center;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-gray);
  margin-bottom: 5px;
  letter-spacing: 1px;
}

.stat-value {
  font-family: var(--font-tech);
  font-size: 1.5rem;
  font-weight: 900;
  text-shadow: 0 0 10px currentColor;
}

.stat-value.red {
  color: var(--text-red);
}

.stat-value.green {
  color: var(--text-green);
}

.stat-value.yellow {
  color: var(--text-yellow);
}

/* Attack Types */
.attack-types {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attack-type-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: rgba(255, 0, 68, 0.1);
  border-left: 3px solid var(--text-red);
  border-radius: 3px;
}

.attack-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.attack-count {
  font-family: var(--font-tech);
  font-weight: 700;
  color: var(--text-red);
}

/* Targets and Countries */
.targets-list,
.country-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.target-item,
.country-item {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 3px;
}

.target-name,
.country-name {
  font-size: 0.85rem;
  color: var(--text-white);
}

.target-count,
.country-count {
  font-family: var(--font-tech);
  font-weight: 700;
  color: var(--text-yellow);
}

/* Attack Feed */
.attack-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.75rem;
}

.attack-item {
  padding: 8px;
  background: rgba(255, 0, 68, 0.1);
  border-left: 2px solid var(--text-red);
  border-radius: 3px;
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.attack-time {
  color: var(--text-gray);
  font-size: 0.7rem;
}

.attack-desc {
  color: var(--text-white);
  margin-top: 3px;
}

.attack-source {
  color: var(--text-red);
  font-weight: 600;
}

.attack-target {
  color: var(--text-yellow);
  font-weight: 600;
}

/* Protocols */
.protocols {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.protocol-bar {
  display: grid;
  grid-template-columns: 60px 1fr 50px;
  align-items: center;
  gap: 10px;
}

.protocol-name {
  font-size: 0.8rem;
  font-weight: 700;
}

.protocol-fill {
  height: 18px;
  background: linear-gradient(90deg, var(--text-cyan), rgba(0, 255, 255, 0.5));
  border-radius: 3px;
  box-shadow: 0 0 10px var(--glow-cyan);
  animation: pulse 2s ease-in-out infinite;
}

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

.protocol-pct {
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
}

/* Map Container */
.map-container {
  position: relative;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid var(--border-cyan);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

#attackMap {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

/* Leaflet marker styles */
.pulsing-marker {
  background: transparent !important;
  border: none !important;
}

.marker-pulse {
  width: 10px;
  height: 10px;
  background: var(--text-cyan);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: markerPulse 2s ease-out infinite;
  box-shadow: 0 0 15px var(--glow-cyan);
}

@keyframes markerPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

.marker-label {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-tech);
  white-space: nowrap;
  text-shadow: 0 0 10px var(--glow-cyan);
  color: var(--text-cyan);
  pointer-events: none;
}

.attack-marker {
  background: transparent !important;
  border: none !important;
}

.map-overlay {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border-cyan);
  padding: 10px 20px;
  border-radius: 5px;
  pointer-events: none;
}

.timestamp {
  font-family: var(--font-tech);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 0 10px var(--glow-cyan);
}

/* Bottom Bar */
.bottom-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 20px;
  background: rgba(0, 20, 40, 0.95);
  border-top: 2px solid var(--border-cyan);
  box-shadow: 0 0 20px var(--glow-cyan);
  position: relative;
  z-index: 100;
}

.bar-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-label {
  font-size: 0.8rem;
  color: var(--text-gray);
  font-weight: 600;
  letter-spacing: 1px;
}

.bar-value {
  font-family: var(--font-tech);
  font-weight: 700;
  text-shadow: 0 0 10px currentColor;
}

.bar-value.green {
  color: var(--text-green);
}

.bar-value.cyan {
  color: var(--text-cyan);
}

.bar-value.yellow {
  color: var(--text-yellow);
}

/* Blinking Animation */
.blink {
  animation: blink 1.5s steps(2) infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.3; }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
  background: var(--border-cyan);
  border-radius: 3px;
}

/* Responsive */
@media (max-width: 1400px) {
  .main-container {
    grid-template-columns: 250px 1fr 250px;
  }
}

@media (max-width: 1024px) {
  .main-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .side-panel {
    flex-direction: row;
    overflow-x: auto;
  }

  .panel-section {
    min-width: 250px;
  }
}
