/*
  Pulse by SearchSwitchSave.com V1.7
  Final CSS for Pulse with flicker-free (i) tooltips in Chrome:
  - Two-line header layout
  - Thicker progress bar (green-to-blue gradient)
  - Extended results for latency, jitter, lat/lon, test times
  - Responsive design
  - .info-icon-wrapper + .info-tooltip approach with no-gap positioning
*/

/* Import Poppins font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body & Layout */
body {
  font-family: 'Poppins', sans-serif;
  background: #ffffff;
  color: #000000;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.pulse-header {
  background: #000;
  color: #fff;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pulse-header-left {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.pulse-logo {
  font-size: 1.5rem;
  font-weight: 600;
  margin-right: 0.5rem;
}
.byline {
  font-size: 0.75rem;
  color: #ccc;
}
/* Right side: 2 lines for IP/ISP/Location + Browser/OS/Time */
.pulse-header-right {
  font-size: 0.9rem;
  color: #ccc;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}
.header-line-1,
.header-line-2 {
  display: flex;
  gap: 1rem;
}
.header-line-1 span,
.header-line-2 span {
  white-space: nowrap;
}

/* (i) Tooltip Wrapper */
.info-icon-wrapper {
  position: relative;
  display: inline-flex; /* Prevent flicker by creating a bigger hover box */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #666;
  font-size: 0.8rem;

  /* Increase the hit area so the tooltip is directly below.
     This helps ensure no flicker in Chrome. */
  padding: 2px 4px;
  line-height: 1;
  
}

/* Tooltip box hidden by default */
.info-tooltip {
  display: none;
  position: absolute;
  /* Place the tooltip slightly below (i), overlapping the parent’s area. */
  top: 2rem; 
  left: 50%;
  transform: translateX(-50%);
  
  background: #fff;
  color: #333;
  padding: 0.6rem 0.8rem;
  border: 1px solid #007aff;
  border-radius: 4px;
  font-size: 0.85rem;
  word-wrap: break-word; /* Ensure words break if too long */
  overflow-wrap: break-word; /* Alternative for better compatibility */
  width: 300px;
  z-index: 999;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);

  /* Let users select/copy text in the tooltip. */
  pointer-events: auto;
}


.info-icon-wrapper.right-edge .info-tooltip {
  left: auto;
  right: 0;
  transform: translateX(0);
}


/* Show tooltip when hovering the wrapper */
.info-icon-wrapper:hover .info-tooltip {
  display: block;
}

/* Blue arrow at bottom of tooltip, pointing up at the icon */
.info-tooltip::before {
  content: "";
  position: absolute;
  bottom: 100%; /* Place arrow at bottom of tooltip, pointing up. */
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #007aff;
  z-index: 1000;
}

/* Optional styling for emojis in extended results */
.emoji {
  margin-right: 0.3rem;
}

/* Main Container */
.pulse-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Thicker Progress Bar with Green-to-Blue Gradient */
.progress-wrapper {
  width: 90%;
  max-width: 800px;
  height: 35px;
  background: #ddd;
  border-radius: 25px;
  margin-bottom: 2rem;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4cd964, #007aff);
  transition: width 0.3s ease;
}

/* Speed Display */
.speed-display {
  margin-bottom: 0.5rem;
  text-align: center;
}
.main-label {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #333;
}
.speed-line {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem;
}
#speedValue {
  font-weight: 700;
  letter-spacing: -11px;
  transition: color 0.5s ease, font-size 0.5s ease;
}
/* Running state: blue-green gradient with glow */
.speed-running {
  color: #00aaff;
  text-shadow: 0 0 8px rgba(0, 200, 150, 0.8);
  background: -webkit-linear-gradient(45deg, #00aaff, #2ecc71);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* Final state: black-blue gradient */
.speed-final {
  color: #000;
  background: -webkit-linear-gradient(45deg, #000, #007aff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
@media (min-width: 768px) {
  #speedValue {
    font-size: 15rem;
  }
}
@media (max-width: 767px) {
  #speedValue {
    font-size: 4.5rem;
  }
}
.speed-unit {
  font-size: 1.5rem;
  color: #555;
}

/* Speed Category Box */
.speed-category {
  margin-top: 1rem;
  font-size: 1rem;
  color: #333;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 15px;
  padding: 1rem 1.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.results-header {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.speed-advice {
  margin-top: 1rem;
  font-size: 1rem;
  color: #555;
  text-align: center;
  line-height: 1.4;
}

/* Results Container */
.results-container {
  text-align: center;
  margin-top: 1rem;
}
.hidden {
  display: none !important;
}
.final-line {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Buttons */
.rerun-btn {
  background: #444;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.rerun-btn:hover {
  background: #666;
}
.show-more-btn {
  background: #555;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 1rem;
}
.show-more-btn:hover {
  background: #777;
}

/* Extended Results */
.extended-results {
  margin: 0 auto;
  max-width: 400px;
  text-align: left;
}
.extended-results-header {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.stats-table td {
  padding: 0.5rem 0;
  vertical-align: middle;
}

/* Footer */
.pulse-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: #666;
  border-top: 1px solid #eee;
}
.pulse-footer a {
  color: #007aff;
  text-decoration: none;
}
.pulse-footer a:hover {
  text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .pulse-header {
    flex-wrap: wrap;
    padding: 1rem;
  }
  .pulse-header-left {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  .pulse-header-right {
    width: 100%;
    font-size: 0.8rem;
    line-height: 1.3;
    align-items: flex-start;
    text-align: left;
  }
  .header-line-1,
  .header-line-2 {
    gap: 0.5rem;
  }
  /* Uncomment to put each stat on its own line on mobile:
  .header-line-1 span, .header-line-2 span {
    display: block;
  }
  */
  .pulse-logo {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .progress-wrapper {
    width: 90%;
  }
  .show-more-btn, .rerun-btn {
    font-size: 0.85rem;
  }
}

.pulse-header-right .info-tooltip {
  white-space: normal;
  
}

/* NEW: Share Section Styles */
.share-container {
  margin-top: 1rem;
  text-align: center;
}

.share-btn {
  background: #007aff;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.share-options a, .share-options button {
  background: #f4f4f4;
  color: #007aff;
  border: 1px solid #007aff;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  border-radius: 4px;
  margin: 0 0.2rem;
  text-decoration: none;
  cursor: pointer;
}

.share-options a:hover, .share-options button:hover {
  background: #007aff;
  color: #fff;
}
