/* Contenedor Principal Unificado - Súper Colorido y Premium */
.speedtest-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-height: 350px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b0764 100%);
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 15px 40px rgba(30, 58, 138, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  color: #ffffff; /* Alto contraste forzado */
}

/* Start Overlay */
#startOverlay {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Botón Central Elegante y Colorido */
#btnStart.btn-start {
  width: 140px !important;
  height: 140px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  border: none;
  background: linear-gradient(135deg, #3B82F6, #8B5CF6, #EC4899) !important;
  color: #ffffff !important;
  font-size: 20px !important;
  font-weight: 900 !important;
  letter-spacing: 2px !important;
  cursor: pointer;
  box-shadow: 
    0 10px 25px rgba(236, 72, 153, 0.4),
    inset 0 0 0 2px rgba(255, 255, 255, 0.5) !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  z-index: 2;
  outline: none !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#btnStart.btn-start:hover {
  transform: translateY(-5px) scale(1.05) !important;
  box-shadow: 
    0 20px 40px rgba(139, 92, 246, 0.6),
    inset 0 0 0 2px rgba(255, 255, 255, 0.8) !important;
}

#btnStart.btn-start:active {
  transform: scale(0.95) !important;
  box-shadow: 0 5px 15px rgba(236, 72, 153, 0.4) !important;
}

#btnStart.btn-start.running {
  pointer-events: none;
  animation: pulseButton 2s infinite;
  background: linear-gradient(135deg, #10B981, #3B82F6) !important;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.6);
}

@keyframes pulseButton {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 20px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Gauge */
.gauge-container {
  position: relative;
  width: 260px;
  height: 160px;
  margin-top: 10px;
}

.gauge-svg { width: 100%; height: 100%; }
.gauge-bg { stroke: rgba(255,255,255,0.1); }
.gauge-fill {
  stroke: url(#gaugeGradient);
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 0.1s linear;
  filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.8));
}

.gauge-center {
  position: absolute;
  bottom: 15px;
  left: 0;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.gauge-value {
  font-size: 50px;
  font-weight: 900;
  color: #ffffff;
  font-family: 'Consolas', monospace;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  line-height: 1;
}

.gauge-unit {
  font-size: 16px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 2px;
  margin-top: 2px;
}

/* Status text */
.test-status {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Results Grid (Colorful Glassmorphism) */
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  width: 100%;
  margin-top: 10px;
  margin-bottom: 20px;
}

.result-box {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.result-box:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.result-box.active {
  background: rgba(59, 130, 246, 0.3);
  border-color: #60A5FA;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  transform: scale(1.02);
}

.result-box i {
  font-size: 22px;
  color: #ffffff;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.2);
}

.ping-box i { background: linear-gradient(135deg, #F59E0B, #D97706); }
.dl-box i { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.ul-box i { background: linear-gradient(135deg, #8B5CF6, #6D28D9); }

.res-text { display: flex; flex-direction: column; }
.res-label {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}
.res-val {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  font-family: 'Consolas', monospace;
  text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.res-val small { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.7); }

/* Network Info (Colorful Glassmorphism) */
.network-info {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 15px;
  width: 100%;
}

.net-card {
  min-width: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.net-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  color: #ffffff;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
}

.net-text { flex: 1; min-width: 0; }
.net-text span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}
.net-text div {
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .speedtest-wrapper { padding: 20px; }
  .results-grid { grid-template-columns: 1fr; }
  .network-info { grid-template-columns: 1fr; }
}
