/* Styles principaux IPWatch - Thème Monokai */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Variables CSS Monokai */
:root {
  --monokai-bg: #272822;
  --monokai-text: #F8F8F2;
  --monokai-comment: #30BF97;
  --monokai-green: #A6E22E;
  --monokai-pink: #F92672;
  --monokai-cyan: #66D9EF;
  --monokai-purple: #AE81FF;
  --monokai-yellow: #E6DB74;
  --monokai-orange: #FD971F;
  --monokai-blue-dark: #1E3A8A;
  --monokai-blue-light: #3B82F6;
}

/* Base */
body {
  margin: 0;
  padding: 0;
  background-color: var(--monokai-bg);
  color: var(--monokai-text);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.no-select {
  user-select: none;
}

/* Animation halo ping */
@keyframes ping-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(102, 217, 239, 0.7);
  }
  50% {
    box-shadow: 0 0 20px 10px rgba(102, 217, 239, 0.3);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(102, 217, 239, 0);
  }
}

.ping-animation {
  animation: ping-pulse 1.5s ease-in-out infinite;
}

/* Grille des IPs avec espacement configurable */
.ip-grid {
  gap: var(--cell-gap, 2px);
}

/* Cases IP compactes - Version minimale */
.ip-cell-compact {
  @apply rounded cursor-pointer transition-all duration-200 relative;
  border: 1px solid;
  width: var(--cell-size, 30px);
  height: var(--cell-size, 30px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size, 10px);
}

/* Cases IP - États selon guidelines-css.md */
.ip-cell {
  @apply rounded-lg p-3 cursor-pointer transition-all duration-200;
  border: 2px solid;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* IP libre */
.ip-cell.free,
.ip-cell-compact.free {
  background-color: rgba(117, 113, 94, 0.2);
  border-color: var(--monokai-comment);
  color: var(--monokai-comment);
}

/* IP en ligne + connue (vert) */
.ip-cell.online-known,
.ip-cell-compact.online-known {
  background-color: rgba(166, 226, 46, 0.15);
  border-color: var(--monokai-green);
  border-style: solid;
  color: var(--monokai-text);
}

.ip-cell.online-known:hover,
.ip-cell-compact.online-known:hover {
  background-color: rgba(166, 226, 46, 0.25);
}

/* IP en ligne + inconnue (cyan) */
.ip-cell.online-unknown,
.ip-cell-compact.online-unknown {
  background-color: rgba(102, 217, 239, 0.15);
  border-color: var(--monokai-cyan);
  border-style: solid;
  color: var(--monokai-text);
}

.ip-cell.online-unknown:hover,
.ip-cell-compact.online-unknown:hover {
  background-color: rgba(102, 217, 239, 0.25);
}

/* IP hors ligne + connue (rose) */
.ip-cell.offline-known,
.ip-cell-compact.offline-known {
  background-color: rgba(249, 38, 114, 0.1);
  border-color: var(--monokai-pink);
  border-style: dashed;
  color: var(--monokai-text);
  opacity: 0.5;
  position: relative;
}

/* IP hors ligne + inconnue (violet) */
.ip-cell.offline-unknown,
.ip-cell-compact.offline-unknown {
  background-color: rgba(174, 129, 255, 0.1);
  border-color: var(--monokai-purple);
  border-style: dashed;
  color: var(--monokai-text);
  opacity: 0.5;
  position: relative;
}

/* Point jaune pour équipements réseau hors ligne - utilise ::after pour échapper à l'opacité du parent */
.ip-cell-compact.network-device-offline::after {
  content: '';
  position: absolute;
  bottom: 0.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0.375rem;  /* 1.5 = 6px */
  height: 0.375rem;
  border-radius: 50%;
  background-color: #FBBF24;
  box-shadow: 0 0 6px #FBBF24, 0 0 10px rgba(251, 191, 36, 0.6);
  opacity: 1 !important;
  z-index: 100;
  pointer-events: none;
}

/* MAC address changée (orange - alerte) */
.ip-cell.mac-changed,
.ip-cell-compact.mac-changed {
  border-color: var(--monokai-orange) !important;
  border-width: 2px !important;
  border-style: solid !important;
  box-shadow: 0 0 10px rgba(253, 151, 31, 0.5);
}

/* Équipements réseau (switches, routeurs, bornes WiFi) */
/* En ligne : bordure bleue foncée + fond bleu */
.ip-cell.network-device-online,
.ip-cell-compact.network-device-online {
  background-color: rgba(30, 58, 138, 0.25);
  border-color: var(--monokai-blue-dark);
  border-style: solid;
  border-width: 3px;
  color: var(--monokai-text);
}

.ip-cell.network-device-online:hover,
.ip-cell-compact.network-device-online:hover {
  background-color: rgba(30, 58, 138, 0.35);
}

/* Hors ligne : utilise le style normal (offline-known/offline-unknown) + point bleu en bas */
/* Le point bleu est affiché via le template HTML */

/* Sélection */
.ip-cell.selected {
  box-shadow: 0 0 20px rgba(230, 219, 116, 0.5);
  border-color: var(--monokai-yellow);
}

.ip-cell-compact.selected {
  box-shadow:
    inset 0 0 6px rgba(230, 219, 116, 0.9),
    inset 0 0 12px rgba(230, 219, 116, 0.6),
    0 0 6px rgba(230, 219, 116, 0.2);
  border-color: var(--monokai-yellow);
  border-width: 2px;
}

/* Scrollbar custom Monokai */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #1e1f1c;
}

::-webkit-scrollbar-thumb {
  background: var(--monokai-comment);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--monokai-cyan);
}
