/* Enterprise Speed Test Styles - Dark Theme Matching Website */

.speed-test-enterprise {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #e0e0e0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #334155;
}

/* Header */
.speed-test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #334155;
}

.speed-test-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 700;
  color: #38bdf8;
}

.speed-test-title svg {
  width: 32px;
  height: 32px;
  color: #f97316;
}

.speed-test-badge {
  font-size: 12px;
  color: #64748b;
}

/* Main Speed Display */
.speed-main-display {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.speed-section {
  text-align: center;
  padding: 20px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid #334155;
  transition: all 0.3s ease;
}

.speed-section.download {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(30, 41, 59, 0.9) 100%);
  border-color: rgba(245, 158, 11, 0.3);
}

.speed-section.upload {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(30, 41, 59, 0.9) 100%);
  border-color: rgba(139, 92, 246, 0.3);
}

.speed-section.latency {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(30, 41, 59, 0.9) 100%);
  border-color: rgba(56, 189, 248, 0.3);
}

.speed-section.active {
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.speed-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.speed-section-title .info-icon {
  width: 16px;
  height: 16px;
  cursor: help;
  opacity: 0.5;
  color: #64748b;
}

.speed-value-large {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  color: #f1f5f9;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.speed-unit {
  font-size: 16px;
  font-weight: 500;
  color: #64748b;
}

.speed-graph-container {
  height: 60px;
  margin-top: 12px;
  position: relative;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 6px;
  overflow: hidden;
}

.speed-graph {
  width: 100%;
  height: 100%;
  position: relative;
}

.speed-graph svg {
  width: 100%;
  height: 100%;
}

.speed-graph-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.speed-graph-area {
  opacity: 0.3;
}

/* Latency Details */
.latency-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.latency-detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 8px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
}

.latency-detail-label {
  color: #64748b;
}

.latency-detail-value {
  font-weight: 600;
  color: #38bdf8;
}

/* Server Location Panel */
.server-location-panel {
  background: rgba(30, 41, 59, 0.6);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  border: 1px solid #334155;
}

.server-location-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #38bdf8;
  margin-bottom: 12px;
}

.server-location-content {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.server-location-content > * {
  flex: 1;
  min-width: 200px;
}

.server-map {
  flex: 1;
  height: 160px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid #334155;
}

.server-map-placeholder {
  text-align: center;
  color: #64748b;
  font-size: 12px;
}

.server-map-marker {
  position: absolute;
  width: 24px;
  height: 24px;
  background: #ef4444;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
  animation: pulse-marker 2s infinite;
}

@keyframes pulse-marker {
  0%, 100% { transform: rotate(-45deg) scale(1); opacity: 1; }
  50% { transform: rotate(-45deg) scale(1.2); opacity: 0.8; }
}

.server-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.server-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #94a3b8;
}

.server-info-item svg {
  width: 16px;
  height: 16px;
  color: #64748b;
}

.server-info-label {
  font-weight: 500;
  color: #64748b;
}

.server-info-value {
  color: #38bdf8;
  font-weight: 600;
  margin-left: auto;
}

/* Control Buttons */
.speed-test-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.speed-test-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.speed-test-btn.primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.speed-test-btn.primary:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}

.speed-test-btn.secondary {
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  border: 1px solid #334155;
}

.speed-test-btn.secondary:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #e2e8f0;
  border-color: #475569;
}

.speed-test-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Network Quality Score */
.quality-score-section {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(30, 41, 59, 0.8) 100%);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.quality-score-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #22c55e;
  margin-bottom: 16px;
}

.quality-scores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.quality-score-item {
  text-align: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  border: 1px solid #334155;
}

.quality-score-label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.quality-score-value {
  font-size: 18px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 16px;
  display: inline-block;
}

.quality-score-value.great {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.quality-score-value.good {
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(132, 204, 22, 0.3);
}

.quality-score-value.fair {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.3);
}

.quality-score-value.poor {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Detailed Measurements */
.detailed-measurements {
  background: rgba(30, 41, 59, 0.6);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #334155;
}

.measurements-header {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 16px;
}

.measurements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.measurement-category {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #334155;
}

.measurement-category-title {
  font-size: 14px;
  font-weight: 600;
  color: #38bdf8;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  cursor: pointer;
}

.measurement-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #334155;
  font-size: 13px;
}

.measurement-item:last-child {
  border-bottom: none;
}

.measurement-label {
  color: #64748b;
}

.measurement-value {
  font-weight: 600;
  color: #e2e8f0;
}

/* Box Plot Visualization */
.box-plot {
  height: 40px;
  position: relative;
  margin: 8px 0;
}

.box-plot-svg {
  width: 100%;
  height: 100%;
}

.box-plot-line {
  stroke: #475569;
  stroke-width: 1;
}

.box-plot-box {
  fill: #38bdf8;
  opacity: 0.3;
}

.box-plot-median {
  stroke: #38bdf8;
  stroke-width: 2;
}

/* Status Bar */
.test-status-bar {
  text-align: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  margin-top: 16px;
  border: 1px solid #334155;
}

.test-status-text {
  font-size: 14px;
  color: #94a3b8;
}

.test-timestamp {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

/* Hidden by default */
.hidden {
  display: none !important;
}


/* Server Selection Section */
.server-selection-section {
  flex: 1;
  min-width: 200px;
}

.server-selector-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.server-selector-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.server-selector-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
}

.server-selector-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.server-selector-dropdown {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
  color: #e2e8f0;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  min-width: 180px;
  appearance: auto;
}

.server-selector-dropdown:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.server-selector-dropdown option,
.server-selector-dropdown optgroup {
  background: #0f172a;
  color: #e2e8f0;
}

.server-compare-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid #334155;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.server-compare-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #e2e8f0;
  border-color: #475569;
}

.current-server-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #94a3b8;
  margin-top: 4px;
}

.server-flag {
  font-size: 14px;
}

.server-name {
  font-weight: 500;
  color: #38bdf8;
}

/* Server Comparison Panel */
.server-comparison-panel {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
}

.server-comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.server-comparison-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.server-comparison-close:hover {
  color: #e2e8f0;
}

.server-comparison-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.server-comparison-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #334155;
}

.latency-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: #64748b;
}

.latency-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 2px;
}

.latency-dot.excellent { background: #22c55e; }
.latency-dot.good { background: #84cc16; }
.latency-dot.fair { background: #eab308; }
.latency-dot.poor { background: #ef4444; }

/* Responsive */
@media (max-width: 768px) {
  .speed-main-display {
    grid-template-columns: 1fr;
  }
  
  .quality-scores-grid {
    grid-template-columns: 1fr;
  }
  
  .measurements-grid {
    grid-template-columns: 1fr;
  }
  
  .server-location-content {
    flex-direction: column;
  }
  
  .speed-value-large {
    font-size: 36px;
  }
  
  .speed-test-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .speed-test-btn {
    justify-content: center;
  }
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.testing .speed-value-large {
  animation: pulse 1s infinite;
}

/* Fix for dark theme text */
.speed-test-enterprise h3,
.speed-test-enterprise h4 {
  color: #f1f5f9;
}

.speed-test-enterprise p {
  color: #94a3b8;
}

.speed-test-enterprise span {
  color: #94a3b8;
}
