/**
 * SIME SpeedTest - SIME Purple Theme
 * Matching the official SIME brand identity
 */

/*
 * SIME Speed Test Theme
 * Custom styling for SIME branding
 */

/* Use system fonts instead of Google Fonts for offline compatibility */

/* Define font families using system fonts */
:root {
  --font-family-primary: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-secondary: "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root {
  --color-primary: #360f4f;
  --color-secondary: #7f559a;
  --color-darkBlue: #1e0a59;
  --color-pink: #dfb1ff;
  --shadow-hero: 20px 2px 14px 0 rgba(121, 57, 161, 0.21);
  --gradient-primary: #ffffff;
  --gradient-secondary: linear-gradient(45deg, #360f4f, var(--color-secondary));
  --card-background: rgba(54, 15, 79, 0.1);
  --border-color: rgba(54, 15, 79, 0.2);
  --text-primary: #360f4f;
  --text-secondary: rgba(54, 15, 79, 0.9);
  --text-muted: rgba(54, 15, 79, 0.7);
}

body {
  font-family: var(--font-family-primary);
  background: var(--gradient-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
  color: var(--text-primary);
}

/* Override default speedtest styling */
.openSpeedtestApp {
  background: var(--gradient-primary) !important;
  font-family: var(--font-family-primary) !important;
}

/* Main UI container styling */
.uiBg {
  fill: rgba(54, 15, 79, 0.05) !important;
}

/* Cards styling */
.Cards {
  fill: var(--card-background) !important;
  stroke: var(--border-color) !important;
  stroke-width: 1.5px !important;
  filter: drop-shadow(var(--shadow-hero)) !important;
}

/* Text styling updates */
.rtext {
  font-family: var(--font-family-primary) !important;
  font-weight: 500 !important;
  fill: var(--text-secondary) !important;
  letter-spacing: -0.34px !important;
}

.rtextnum {
  font-family: "Poppins", sans-serif !important;
  font-weight: 600 !important;
  fill: var(--text-primary) !important;
  letter-spacing: -1.82px !important;
}

.rtextmbms {
  font-family: var(--font-family-primary) !important;
  font-weight: 500 !important;
  fill: var(--text-muted) !important;
  letter-spacing: -0.34px !important;
}

.jitter-Mob {
  font-family: var(--font-family-primary) !important;
  font-weight: 500 !important;
  fill: var(--text-muted) !important;
}

/* Gauge styling */
.main-Gaugebg {
  stroke: rgba(54, 15, 79, 0.2);
  stroke-width: 2;
}

/* Button styling for SIME-style buttons */
.startButton {
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.2s ease;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--color-primary) !important;
}

.startButton:hover {
  opacity: 0.9;
}

.buttonTxt {
  font-family: var(--font-family-primary);
  font-size: 18px;
  font-weight: 600;
  fill: #ffffff;
  pointer-events: none;
  user-select: none;
}

/* Center the start button in the gauge */
#startb {
  transform: translate(-110px, -40px);
  transform-origin: center;
}

/* Center the restart button in the gauge */
#restartb {
  transform: translate(-110px, -40px);
  transform-origin: center;
  display: none;
}

/* Hide upload icon when test is complete */
.test-complete #upSymbol {
  display: none !important;
}

/* Show restart button when test is complete */
.test-complete #restartb {
  display: block !important;
}

.main-GaugeBlue {
  stroke: url(#simeGradient) !important;
  stroke-width: 18px !important;
}

.main-GaugeWhite {
  stroke: var(--color-secondary) !important;
  stroke-width: 12px !important;
}

/* Speed display */
.oDoLive-Speed {
  font-family: "Poppins", sans-serif !important;
  font-weight: 600 !important;
  font-size: 32px !important;
  fill: var(--text-primary) !important;
  letter-spacing: -1.82px !important;
}

.oDoLive-Status {
  font-family: var(--font-family-primary) !important;
  font-weight: 500 !important;
  fill: var(--text-secondary) !important;
  letter-spacing: -0.34px !important;
}

/* Odometer styling */
.oDo-Meter {
  font-family: var(--font-family-primary) !important;
  font-weight: 500 !important;
  fill: var(--text-muted) !important;
  font-size: 14px !important;
  letter-spacing: -0.34px !important;
}

.oDoTop-Speed {
  font-family: var(--font-family-primary) !important;
  font-weight: 500 !important;
  fill: var(--text-muted) !important;
  letter-spacing: -0.34px !important;
}

/* Start button styling */
.startButton {
  fill: url(#simeButtonGradient) !important;
  filter: drop-shadow(0 4px 0 rgba(30, 10, 89, 0.6)) !important;
  transition: all 0.3s ease !important;
}

/* Progress bars */
.progressbg {
  stroke: rgba(54, 15, 79, 0.2) !important;
  stroke-width: 6px !important;
}

.buttonTxt {
  font-size: 65px;
  fill: #ffffff;
  font-family: Roboto-Medium, Roboto;
  font-weight: 500;
  text-anchor: middle;
}

.intro-Progress,
.progressElmstart {
  stroke: var(--color-secondary) !important;
  stroke-width: 6px !important;
}

/* Symbol styling */
.Symbol {
  fill: var(--color-secondary) !important;
}

#upSymbolDesk,
#downSymbolDesk,
#upSymbolMob,
#downSymbolMob,
#pingSymbol,
#jitterSymbol {
  fill: #ffffff !important;
}

/* Icon color overrides */
#upSymbolDesk,
#downSymbolDesk,
#upSymbolMob,
#downSymbolMob,
#pingSymbol,
#jitterSymbol {
  fill: #ffffff !important;
}

/* Ping and Jitter icon styling - make them slightly bigger */
use[xlink\:href="#pingSymbol"],
use[xlink\:href="#jitterSymbol"] {
  fill: #ffffff !important;
  transform: scale(1.15) !important;
  transform-origin: center !important;
}

/* IP display */
#ipMob,
#ipDesk {
  font-family: var(--font-family-primary) !important;
  font-weight: 500 !important;
  fill: var(--text-secondary) !important;
  letter-spacing: -0.34px !important;
}

/* Settings button */
.Startsettings {
  fill: url(#simeButtonGradient) !important;
  opacity: 0.3 !important;
  transition: opacity 0.3s ease !important;
}

.Startsettings:hover {
  opacity: 1 !important;
}

/* Loading spinner */
.spinner > div {
  background-color: var(--color-secondary) !important;
}

/* Credits styling */
.Credits {
  font-family: var(--font-family-primary) !important;
  font-weight: 500 !important;
  color: var(--text-muted) !important;
  letter-spacing: -0.34px !important;
  padding: 20px;
  margin-top: 20px;
}

.Credits a {
  color: var(--color-secondary) !important;
  text-decoration: none !important;
  transition: color 0.3s ease !important;
}

.Credits a:hover {
  color: var(--text-primary) !important;
  text-decoration: underline !important;
}

/* Custom gradient definitions */
.sime-gradients {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Dark mode overrides */
body.dark-mode {
  background: var(--gradient-primary) !important;
}

/* Mobile responsive adjustments */
@media only screen and (max-width: 768px) {
  .oDoLive-Speed {
    font-size: 28px !important;
  }

  .rtextnum {
    font-size: 20px !important;
  }

  .buttonTxt {
    font-size: 36px !important;
  }
}

@media only screen and (max-width: 480px) {
  .Credits {
    font-size: 12px !important;
    padding: 15px !important;
  }

  .oDoLive-Speed {
    font-size: 24px !important;
  }

  .rtextnum {
    font-size: 18px !important;
  }
}

/* Animation enhancements */
@keyframes sime-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.main-GaugeBlue.active {
  animation: sime-pulse 2s ease-in-out infinite;
}

/* Additional SIME brand elements */
.sime-logo {
  font-family: "Poppins", sans-serif !important;
  font-weight: 600 !important;
  font-size: 18px !important;
  fill: var(--text-primary) !important;
  letter-spacing: -0.34px !important;
}

/* Enhanced card styling for better SIME integration */
.result-card {
  background: var(--card-background) !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: 16px !important;
  backdrop-filter: blur(20px) !important;
  box-shadow: var(--shadow-hero) !important;
}

/* Status indicators with SIME colors */
.status-excellent {
  fill: #10b981 !important;
}
.status-good {
  fill: #f59e0b !important;
}
.status-poor {
  fill: #ef4444 !important;
}

/* Restart button styling */
.restartButton {
  fill: url(#simeButtonGradient) !important;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
  -webkit-tap-highlight-color: transparent !important;
  cursor: pointer !important;
  pointer-events: visible !important;
  display: none !important;
  filter: drop-shadow(0 4px 0 rgba(30, 10, 89, 0.6)) !important;
  transition: all 0.3s ease !important;
}

.restartButton.show {
  display: inline !important;
}

.restartButton:hover {
  transform: translateY(2px) !important;
  filter: drop-shadow(0 2px 0 rgba(30, 10, 89, 0.6)) !important;
}
