@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;700;900&display=swap');

/* roboto-regular - latin */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("..fonts/roboto-v30-latin-regular.eot");
  /* IE9 Compat Modes */
  src: local(""),
    url("../fonts/roboto-v30-latin-regular.eot?#iefix") format("embedded-opentype"),
    /* IE6-IE8 */
    url("../fonts/roboto-v30-latin-regular.woff2") format("woff2"),
    /* Super Modern Browsers */
    url("../fonts/roboto-v30-latin-regular.woff") format("woff"),
    /* Modern Browsers */
    url("../fonts/roboto-v30-latin-regular.ttf") format("truetype"),
    /* Safari, Android, iOS */
    url("../fonts/roboto-v30-latin-regular.svg#Roboto") format("svg");
  /* Legacy iOS */
}

/* roboto-500 - latin */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/roboto-v30-latin-500.eot");
  /* IE9 Compat Modes */
  src: local(""),
    url("assets/fonts/roboto-v30-latin-500.eot?#iefix") format("embedded-opentype"),
    /* IE6-IE8 */
    url("../fonts/roboto-v30-latin-500.woff2") format("woff2"),
    /* Super Modern Browsers */
    url("../fonts/roboto-v30-latin-500.woff") format("woff"),
    /* Modern Browsers */
    url("../fonts/roboto-v30-latin-500.ttf") format("truetype"),
    /* Safari, Android, iOS */
    url("../fonts/roboto-v30-latin-500.svg#Roboto") format("svg");
  /* Legacy iOS */
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  transition: background-color 0.3s ease;
  position: relative;
}

::-webkit-scrollbar {
  display: none;
}

html {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.app-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 24px;
  box-sizing: border-box;
}

/* Larger, borderless floating layout like fast.com */
.glass-card {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  width: 100%;
  max-width: 680px;
  padding: 0;
  box-sizing: border-box;
  margin-bottom: 24px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Fixed header at the top of the viewport */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 30px 40px;
  box-sizing: border-box;
  border-bottom: none !important;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 44px;
  height: 44px;
}

.logo-text-wrapper {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 21px;
  color: #0056c6;
  letter-spacing: 1px;
  line-height: 1;
}

.logo-subtitle {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 9px;
  color: #00e676;
  letter-spacing: 3.5px;
  margin-top: 3px;
  line-height: 1;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 86, 198, 0.05);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid rgba(0, 86, 198, 0.1);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #00e676;
  border-radius: 50%;
  box-shadow: 0 0 8px #00e676;
  animation: pulse 1.8s infinite ease-in-out;
}

.status-text {
  font-size: 11px;
  font-weight: 600;
  color: #0056c6;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 0 12px #00e676;
  }
}

.card-body {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 60px;
}

/* Give explicit height to the root SVG to override browser defaults and scale up */
.openSpeedtestApp {
  width: 100% !important;
  max-width: 500px !important;
  height: 615px !important;
  display: none;
  overflow: visible;
  margin: 0 auto;
}

/* Force mobile stacked layout on all devices and scale up */
.Desktop {
  display: none !important;
  visibility: hidden !important;
}

.Mobile {
  visibility: visible !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

/* Gauge and text elements within SVG */
.main-Gaugebg {
  fill: none;
  stroke: rgba(0, 86, 198, 0.05);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4.5px !important;
  /* Elegant thin progress ring */
  stroke-dasharray: 681;
}

.main-GaugeBlue {
  fill: none;
  stroke: url(#gradient);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5.5px !important;
  stroke-dasharray: 681;
  stroke-opacity: 0;
}

/* Hide speedometer ticks and scale numbers */
.main-GaugeWhite {
  display: none !important;
}

.oDo-Meter text:not(.oDoLive-Speed):not(.oDoLive-Status):not(.oDoLive-Unit) {
  display: none !important;
}

/* Hide graphs to keep gauge minimalist */
.line,
.line2,
#graphMob1,
#graphMob2,
#graphc1,
#graphc2 {
  display: none !important;
}

/* Hide card bounding boxes for results */
.Cards {
  fill: transparent !important;
  stroke: none !important;
}

svg,
symbol,
use,
g,
text {
  overflow: visible !important;
}

.oDo-Meter {
  fill: #6b7280;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 400 !important;
}

/* Make live speed number GIGANTIC relative to SVG viewBox */
.oDoLive-Speed {
  font-size: 60px !important;
  /* Balanced size */
  fill: #111827;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 900;
  text-anchor: middle;
}

.oDoLive-Speed a {
  font-size: 24px !important;
  /* Smaller size to prevent text overflow */
  fill: #0056c6 !important;
  transition: fill 0.2s ease;
}

.oDoLive-Speed a:hover {
  fill: #00e676 !important;
}

#oDoLiveSpeed:has(a) {
  opacity: 0 !important;
  pointer-events: none !important;
}

#gauge-logo {
  display: none !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#oDoLiveSpeed:has(a) ~ #gauge-logo {
  display: block !important;
  opacity: 1;
  pointer-events: all !important;
  cursor: pointer;
}

#oDoLiveSpeed:has(a) ~ .oDoLive-Unit {
  display: none !important;
}

#gauge-logo text {
  display: block !important;
}

.oDoLive-Unit {
  font-size: 20px !important;
  /* Enlarged unit text */
  fill: #0056c6;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 700;
  text-anchor: middle;
  letter-spacing: 0.5px;
}

.oDoLive-Status {
  font-size: 11px !important;
  fill: #6b7280;
  font-family: 'Inter', sans-serif !important;
  font-weight: 700;
  text-anchor: middle;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: all;
}

.uiBg {
  display: none !important;
  /* Hide progress bar icons */
}

.progressbg {
  stroke: rgba(0, 86, 198, 0.05);
  stroke-width: 3px !important;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 0;
}

.Symbol {
  fill: url(#gradient);
}

.rtext {
  font-size: 11px !important;
  fill: #6b7280;
  font-family: 'Inter', sans-serif !important;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.rtextnum {
  font-size: 22px !important;
  /* Reduced from 32px to prevent overlapping/clipping */
  fill: #111827;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 900;
  text-anchor: middle;
}

.rtextmbms {
  font-size: 11px !important;
  fill: #9ca3af;
  font-family: 'Inter', sans-serif !important;
  font-weight: 600;
  text-anchor: middle;
}

.jitter-Mob {
  font-size: 11px !important;
  fill: #9ca3af;
  font-family: 'Inter', sans-serif !important;
  font-weight: 600;
  text-anchor: middle;
}

.startButton {
  fill: url(#RadialGradient1);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  pointer-events: visible;
  filter: drop-shadow(0 4px 12px rgba(0, 86, 198, 0.2));
  transition: all 0.2s ease;
  rx: 12px;
  ry: 12px;
}

.buttonTxt {
  font-size: 34px;
  fill: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  text-anchor: middle;
  letter-spacing: 1px;
}

.intro-Progress {
  stroke: #00e676;
  stroke-width: 3px !important;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 0;
}

.progressElmstart {
  stroke: #00e676;
  stroke-width: 3px !important;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 0;
  display: block;
}

.Startsettings {
  display: none !important;
  /* Hide settings icon to match fast.com minimalist vibe */
}

.deskStart {
  fill: none;
  stroke: rgba(0, 86, 198, 0.05);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4.5px !important;
  stroke-dasharray: 681;
  stroke: url(#gradient);
}

#UI-Desk,
#UI-Mob {
  display: none;
}

#intro-Desk,
#intro-Mob {
  display: none !important;
}

.oDoTop-Speed {
  display: none !important;
  /* Hide max scale speed text */
}

#upSymbolDesk,
#downSymbolDesk,
#upSymbolMob,
#downSymbolMob {
  fill: #0056c6;
  display: none !important;
}

#logo-Desk,
#intro-Mob use[xlink:href="#logo"],
#intro-Desk use[xlink:href="#logo"],
use[xlink:href="#logo"] {
  display: none !important;
}

#ipMob,
#ipDesk {
  font-size: 13px !important;
  fill: #6b7280;
  font-family: 'Inter', sans-serif !important;
  font-weight: 600;
  text-anchor: middle;
  display: none;
}

#ConnectErrorDesk,
#ConnectErrorMob,
.ConnectError {
  display: none;
}

/* Spinner styling */
.spinner {
  position: absolute;
  z-index: 999;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.spinner>div {
  width: 14px;
  height: 14px;
  background-color: #0056c6;
  border-radius: 100%;
  display: inline-block;
  -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
  animation: sk-bouncedelay 1.4s infinite ease-in-out both;
  margin: 0 3px;
}

.spinner .bounce1 {
  -webkit-animation-delay: -0.32s;
  animation-delay: -0.32s;
}

.spinner .bounce2 {
  -webkit-animation-delay: -0.16s;
  animation-delay: -0.16s;
}

@-webkit-keyframes sk-bouncedelay {

  0%,
  80%,
  100% {
    -webkit-transform: scale(0)
  }

  40% {
    -webkit-transform: scale(1.0)
  }
}

@keyframes sk-bouncedelay {

  0%,
  80%,
  100% {
    -webkit-transform: scale(0);
    transform: scale(0);
  }

  40% {
    -webkit-transform: scale(1.0);
    transform: scale(1.0);
  }
}

.darkmode {
  fill: #6b7280;
  display: none;
  cursor: pointer;
  transition: fill 0.2s ease;
}

.darkmode:hover {
  fill: #0056c6;
}

.logo-text-main {
  fill: #0056c6;
  transition: fill 0.3s ease;
}

.logo-text-sub {
  fill: #00e676;
}

/* Progressive results visibility with smooth transitions */
#UI-Mob use[xlink:href="#downloadRc1"],
#UI-Mob use[xlink:href="#downSymbol"],
#UI-Mob use[xlink:href="#downResultC1"],
#UI-Mob use[xlink:href="#uploadRc2"],
#UI-Mob use[xlink:href="#upSymbol"],
#UI-Mob use[xlink:href="#upResultC2"],
#UI-Mob use[xlink:href="#pingRc3"],
#UI-Mob use[xlink:href="#pingSymbol"],
#UI-Mob use[xlink:href="#jitterMob"],
#UI-Mob use[xlink:href="#pingResultC3"],
#UI-Mob use[xlink:href="#jitterResultC3"] {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease-in-out;
}

/* Progressive revealing of results as they finish */
.show-ping #UI-Mob use[xlink:href="#pingRc3"],
.show-ping #UI-Mob use[xlink:href="#pingSymbol"],
.show-ping #UI-Mob use[xlink:href="#jitterMob"],
.show-ping #UI-Mob use[xlink:href="#pingResultC3"],
.show-ping #UI-Mob use[xlink:href="#jitterResultC3"],
.show-download #UI-Mob use[xlink:href="#downloadRc1"],
.show-download #UI-Mob use[xlink:href="#downSymbol"],
.show-download #UI-Mob use[xlink:href="#downResultC1"],
.show-upload #UI-Mob use[xlink:href="#uploadRc2"],
.show-upload #UI-Mob use[xlink:href="#upSymbol"],
.show-upload #UI-Mob use[xlink:href="#upResultC2"] {
  opacity: 1;
  pointer-events: auto;
}

/* Ensure progress bar is always visible during the test */
#UI-Mob use[xlink:href="#progressBar"],
#UI-Mob use[xlink:href="#progressStatus-Mob"] {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Styled TESTAR NOVAMENTE button when test completed */
.show-results .oDoLive-Status {
  fill: #0056c6 !important;
  font-weight: 900 !important;
}

.show-results .oDoLive-Status:hover {
  fill: #00e676 !important;
}

.card-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-top: 20px;
  border-top: none !important;
  padding-top: 0;
}

.btn-show-more {
  background: transparent;
  border: 1px solid rgba(0, 86, 198, 0.25);
  color: #0056c6;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.btn-show-more:hover {
  background: rgba(0, 86, 198, 0.04);
  border-color: #0056c6;
}

.btn-show-more .text-hide {
  display: none;
}

.show-results .btn-show-more .text-show {
  display: none;
}

.show-results .btn-show-more .text-hide {
  display: inline;
}

.btn-restart {
  background: transparent;
  border: 1px solid #00e676;
  color: #008744;
  padding: 8px 20px;
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  display: none;
  /* Only show in results mode */
}

.show-results .btn-restart {
  display: flex;
}

.btn-restart:hover {
  background: rgba(0, 230, 118, 0.05);
  transform: translateY(-1px);
}

.btn-restart svg {
  transition: transform 0.4s ease-in-out;
}

.btn-restart:hover svg {
  transform: rotate(180deg);
}

.Credits {
  color: #9ca3af;
  text-align: center;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  line-height: 1.5;
  margin-top: 40px;
}

.Credits a {
  text-decoration: none;
  color: #6b7280;
  font-weight: 600;
  transition: color 0.2s ease;
}

.Credits a:hover {
  color: #0056c6;
}

@media only screen and (max-width: 480px) {
  .card-header {
    padding: 20px 20px;
  }

  .header-logo {
    width: 38px;
    height: 38px;
  }

  .logo-title {
    font-size: 18px;
  }

  .logo-subtitle {
    font-size: 8px;
    letter-spacing: 3px;
  }

  .connection-status {
    padding: 5px 10px;
  }

  .status-text {
    font-size: 10px;
  }

  .card-body {
    margin-top: 80px;
  }

  .openSpeedtestApp {
    max-width: 290px !important;
    height: 356px !important;
  }
}