/* Network Speed Monitor Styles */

.network-monitor-card {
  margin-bottom: 30px;
}

.realtime-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border-radius: 16px;
  font-size: 10px;
  font-weight: 600;
}

.realtime-badge .pulse-dot,
.realtime-badge .status-indicator {
  width: 5px;
  height: 5px;
  min-width: 5px;
  min-height: 5px;
  font-size: 5px;
  display: inline-block;
  line-height: 1;
}

.pulse-dot {
  animation: pulse 2s ease-in-out infinite;
}

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

/* Speed Test Section */
.speed-test-section {
  margin-bottom: 25px;
}

.speed-display-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.speed-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-radius: 12px;
  border-left: 4px solid #3b82f6;
  transition: all 0.3s ease;
}

.speed-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.speed-item.download {
  border-left-color: #10b981;
}

.speed-item.upload {
  border-left-color: #3b82f6;
}

.speed-item.latency {
  border-left-color: #f59e0b;
}

.speed-item.jitter {
  border-left-color: #8b5cf6;
}

.speed-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 10px;
  font-size: 14px;
}

.speed-item.download .speed-icon {
  color: #10b981;
}

.speed-item.upload .speed-icon {
  color: #3b82f6;
}

.speed-item.latency .speed-icon {
  color: #f59e0b;
}

.speed-item.jitter .speed-icon {
  color: #8b5cf6;
}

.speed-info {
  flex: 1;
}

.speed-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
  font-weight: 600;
}

.speed-value {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  font-family: 'JetBrains Mono', monospace;
}

/* Speed Test Controls */
.speed-test-controls {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 15px;
}

.speed-test-controls .btn {
  flex: 1;
}

.test-status {
  color: #6b7280;
  font-size: 13px;
}

/* Speed Progress */
.speed-progress {
  margin-top: 15px;
}

.speed-progress .progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.speed-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.speed-progress .progress-text {
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
}

/* Network Information Section */
.network-info-section {
  margin-bottom: 25px;
}

.network-info-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 6px;
}

.network-info-section h3 i,
.network-detail-item .detail-label i {
  font-size: 12px;
  opacity: 0.9;
}

.network-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.network-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
  min-height: 44px;
  overflow: hidden;
}

.network-detail-item.highlight-item {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-left: 4px solid #3b82f6;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.network-detail-item .detail-label {
  font-weight: 600;
  color: #4b5563;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.4;
}

.network-detail-item.highlight-item .detail-label {
  color: #1e40af;
  font-size: 12px;
}

.network-detail-item.highlight-item .detail-label i {
  color: #3b82f6;
}

.network-detail-item .detail-value {
  color: #1f2937;
  font-weight: 500;
  font-size: 12px;
  text-align: right;
  flex: 1;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
}

/* Prevent timestamp from wrapping awkwardly */
#last-status-check,
#network-last-updated {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Status Indicators - Compact, small green/red dot */
.status-indicator {
  display: inline-block;
  width: 5px;
  height: 5px;
  min-width: 5px;
  min-height: 5px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}

.status-indicator.online {
  background: #10b981;
  box-shadow: 0 0 2px rgba(16, 185, 129, 0.3);
}

.status-indicator.offline {
  background: #ef4444;
  box-shadow: 0 0 2px rgba(239, 68, 68, 0.3);
}

/* Online status row - compact layout */
.network-detail-item .online-status-value {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

/* Connection Quality Section */
.connection-quality-section {
  margin-bottom: 20px;
}

.connection-quality-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 6px;
}

.connection-quality-section h3 i {
  font-size: 12px;
}

.metric-badge i {
  font-size: 11px;
}

.quality-indicator {
  margin-bottom: 15px;
}

.quality-bar {
  height: 30px;
  background: #e5e7eb;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  margin-bottom: 10px;
}

.quality-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 15px;
  transition: all 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 15px;
}

.quality-label {
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  color: #10b981;
}

.quality-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.metric-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  justify-content: center;
}

.metric-badge.success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #10b981;
}

.metric-badge.warning {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #f59e0b;
}

.metric-badge i {
  font-size: 11px;
}

/* Last Updated */
.last-updated-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 12px;
  color: #6b7280;
}

.last-updated-info i {
  color: #3b82f6;
  font-size: 11px;
}

/* Network card title icon - smaller */
.network-monitor-card .card-icon {
  width: 20px;
  height: 20px;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .speed-display-grid {
    grid-template-columns: 1fr;
  }

  .network-details-grid {
    grid-template-columns: 1fr;
  }

  .speed-test-controls {
    flex-direction: column;
  }

  .speed-test-controls .btn {
    width: 100%;
  }
}

/* Animation for speed values */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.speed-value {
  animation: countUp 0.5s ease-out;
}
