/*----------------- VARIÁVEIS -----------------*/
:root {
  --color-primary: #00AED9;
  --color-primary-light: #66D4EC;
  --color-secondary-dark: #1F2A32;
  --color-white: #FFFFFF;
}

/*----------------- RESET -----------------*/
body, html { 
  margin: 0; 
  padding: 0; 
  height: 100%; 
  font-family: sans-serif; 
}

/*----------------- UTILITÁRIOS -----------------*/
.center-horizontal {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/*----------------- PRELOADER -----------------*/
#preloader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, var(--color-secondary-dark), #050814);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.preloader-content { 
  text-align: center; 
}

.loading-text {
  margin-top: 20px;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--color-primary-light);
}

#device-count {
  margin-top: 6px;
  color: var(--color-primary-light);
  font-size: 12px;
}

/*----------------- NETWORK AREA -----------------*/
.network { 
  position: relative; 
  width: min(600px, 90vw); 
  height: 380px; 
  margin: auto; 
}

#router {
  top: -20%;
}
#router, #switch {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

#switch {
  top: 20%;
}

.devices-container {
  position: absolute;
  top: 70%;
  left: 50%;
  transform: translate(-50%, -50%); 
  
  display: flex;           
  gap: 20px;                
  justify-content: center;  
  align-items: center;      
  flex-wrap: nowrap;      
}

.node {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--color-primary);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-white);
  box-shadow: 0 0 22px rgba(0,174,217,0.45);
  position: relative;
}

.node i { 
  font-size: 20px; 
  color: var(--color-primary-light); 
}

.online::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px; height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
}

canvas#linesCanvas {
  position: absolute;
  top: 0; 
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/*----------------- RESPONSIVO -----------------*/
@media (max-width: 600px) {
  .network { height: 400px; }
  .node { width: 65px; height: 65px; font-size: 10px; }
  .devices-container { gap: 10px; }
  #switch { top: 15%; }
  .devices-container { top: 35%; }
}
