:root {
  --primary-orange: #d35400;
  --dark-gray: #333;
  --light-gray: #f4f4f4;
  --input-border: #d35400;
  --button-bg: #d35400;
  --button-text: #ffffff;
  --pill-success: #00c896;
  --pill-danger: #ff3860;
  --primary-blue: #0059FF;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

.header-nav {
  display: flex;
  gap: 40px;
}

.left-group {
  display: flex;
  align-items: center;
  gap: 60px;
}

.nav-link {
  text-decoration: none;
  font-size: 18px;
  color: #333;
  font-weight: 500;
  transition: color 0.2s;
  min-width: 100px;
}

.nav-link:hover {
  color: var(--primary-blue);
  /* or your brand color */
}



.hero-header {
  border-top: 1px solid #c9d3ff;
  border-bottom: 1px solid #c9d3ff;
  padding: 1rem;
}

.header-wrapper {
  display: flex;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 6%;
}


.tagline {
  font-size: 18px;
  color: gray;
  margin: 0;
  text-align: right;

}

.site-logo {
  height: 32px;
}


.hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.hero-content p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: #e0e0e0;
}

.search-bar {
  display: flex;
  align-items: center;
  max-width: 600px;
  margin: 2rem auto;
  background: #fff;
  border-radius: 40px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  padding: 0.25rem;
  overflow: hidden;
  /*border: 1px solid #c9d3ff;*/
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  color: #333;
  padding: 1rem 1.5rem;
  font-size: 16pt;
  border-radius: 40px 0 0 40px;
}

/* 馃攣 General-purpose reusable button */
.primary-button {
  padding: 1rem 2rem;
  font-size: 14pt;
  background-color: var(--primary-blue);
  color: #fff;
  border: none;
  border-radius: 40px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.primary-button:hover {
  background-color: rgba(0, 47, 255, 0.82);
}

/* 馃攧 Loading state */
.primary-button.loading {
  background-color: #a0c4ff;
  cursor: not-allowed;
  opacity: 0.7;
}

.primary-button.loading:hover {
  background-color: #a0c4ff !important;
}

.search-container {
  display: flex;
  justify-content: center;
  flex-direction: row;
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding: 0;
  margin-left: auto;
  margin-right: auto;
}


.search-container.search-row {
  flex-direction: row;
  align-items: stretch;
  margin: 2rem auto;
}


.search-container.search-row .search-bar {
  flex: 1;
  margin: 0;
}

/* 馃幆 Keep buttons from stretching vertically */
.search-container.search-row .primary-button {
  height: auto;
  white-space: nowrap;
  padding: 1rem 2rem;
}

.primary-button.alt-button {
  background-color: #1c9fdb;
  /* e.g. orange */
}

.primary-button.alt-button:hover {
  background-color: #1c9fdbd9;
}

.button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  /* space between spinner and text */
}



.search-bar button:hover {
  background-color: rgba(32, 73, 255, 0.882);
}

.search-bar input:-webkit-autofill {
  background-color: #fff !important;
  -webkit-box-shadow: 0 0 0px 1000px #fff inset !important;
  -webkit-text-fill-color: #000 !important;
  transition: background-color 5000s ease-in-out 0s;
}

.search-bar input:-webkit-autofill:focus {
  background-color: #fff !important;
}



body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  margin: 0;
  padding: 0;
  background: #f8f9fa;
  color: #333;
}



.search-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.result-box {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  padding: 0rem;
}

/* Make result table bigger and rounded */
.result-table {
  width: 100%;
  max-width: 1000px;
  min-width: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.121);
}

/* Rounded corners on outer table */
.result-box table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  /*border: 1px solid #c9d3ff;*/
  border-radius: 0px;
  overflow: hidden;
  font-size: 1.1rem;
}


.result-box th {
  background-color: #f9f9f9;
  text-align: center;
  padding: 1rem;
  font-size: 1.1rem;
}

.result-box td {
  padding: 1rem;
  align-items: center;
  font-size: 1.05rem;
}

td.centered {
  text-align: center;
}

.result-box .ping-table {
  text-align: center;

}

.table-wrapper {
  width: 100%;
  border-radius: 18px;
  overflow-x: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.121);
}

.ping-table th {
  font-size: 14px;
  background-color: #f6f8ff;
}

.ping-table td {
  padding: 0.6rem 0rem;
  max-width: 300px;
  min-width: 100px;
  font-size: 14px;
}

#pingTableBody tr:nth-child(even) {
  background-color: #f6f8ff; 
}



.carrier-badge {
  padding: 2px 6px;
  border-radius: 4px;
  color: white;
  font-size: 12px;
  font-weight: bold;
  display: inline-block;
}

.badge-mobile {
  background-color: #2ea8b8;
}

.badge-unicom {
  background-color: #ff9c07;
}

.badge-telecom {
  background-color: #3fb562;
}

.badge-overseas {
  background-color: #7f7f7f;
}

.badge-gat {
  background-color: #fe9696;
}

.badge-unknown {
  background-color: #bbb;
}

.sortable {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  color: #333;
  font-weight: bold;
}

/* Row layout for text + arrow group */
.th-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  /* or start/left if you prefer */
}

/* Stack the two arrows vertically */
.arrow {
  display: flex;
  flex-direction: column;
  margin-left: 4px;
  font-size: 8px;
  color: #c5c5c5;
  line-height: 10px;
}

/* Highlight active arrows */
.arrow.active-asc .up {
  color: var(--primary-blue);
}

.arrow.active-desc .down {
  color: var(--primary-blue);
}

.result-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 12px;
  font-size: 14px;
}

input.error {
  border: 1px solid red;
  background-color: #ffeaea;
}


.summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-right {
  color: #666;
}

.chip {
  background: #ffffff;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid #ccc;
}

.chip.active {
  background: var(--primary-blue);
  color: white;
}

.dropdown {
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


.ip-result-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  background: white;
  /* border: 1px solid #ddd; */
  border-radius: 18px;
  overflow: hidden;
  font-size: 1.1rem;
}

/* Header */
.ip-result-table th {
  background-color: #f9f9f9;
  /* padding: 1rem; */
  text-align: center;
  font-size: 1.1rem;
}


/* General cells */
.ip-result-table td {
  font-size: 1.05rem;
  padding: 1rem;
}

.ip-result-table td:first-child {
  width: 25%;
  text-align: right;
  font-weight: 500;
  color: #333;
  
}

.ip-result-table td:last-child {
  width: 75%;
  text-align: left;
  align-items: center;
  color: #333;
}

/* Alternating row colors */
.ip-result-table tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

.ip-result-table tbody tr:nth-child(even) {
  background-color: #f6f8ff;
  /* light blue (AliceBlue) */
}


.pill {
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  color: white;
  display: inline-block;
  text-align: center;
}

.pill.small {
  padding: 3px 6px;
  font-size: 0.65rem;
  border-radius: 6px;
}


.pill.warning {
  background: #f88137;
}

.pill.info {
  background: #3794f8;
}

.pill.success {
  background: #099644;
}

.pill.neutral {
  background-color: #ffc107;
}

.pill.good {
  background-color: #42b300;

}

.pill.critical {
  background-color: #c0392b;
}

.pill.danger {
  background-color: #e74c3c;
  /* red */
}

.pill.unknown {
  background-color: #9d9d9d;
  /* color: #333; */
}



.pill:not(.success):not(.warning):not(.info):not(.good):not(.critical):not(.danger):not(.neutral):not(.unknown) {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 1rem;
}


.tooltip-container {
  position: relative;
  display: inline-block;
}

.info-icon {
  cursor: pointer;
  color: #2a74ff;
  font-size: 16px;
}



.tooltip-text {
  visibility: hidden;
  opacity: 0;
  background-color: #2978ffcf;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  position: absolute;
  bottom: 80%;
  left: 120%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 16px;
  width: 240px;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  transition: opacity 0.2s;
}

/* Show tooltip on hover/focus or tap */
.tooltip-container:hover .tooltip-text,
.tooltip-container:focus-within .tooltip-text,
.tooltip-container.active .tooltip-text {
  visibility: visible;
  opacity: 1;
}



footer {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin: 3rem 0 1rem;
}

.spinner {
  border: 2px solid #ffffff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  width: 1em;
  height: 1em;
  margin-right: 0.5em;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}


.hidden {
  display: none !important;
}


@media (max-width: 600px) {
  .header-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 0px;
  }

  .left-group {
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
  }

  .header-nav {
    display: flex;
    gap: 0rem;
  }

  .nav-link {
    text-align: center;
    width: 100%;
  }

  .search-bar {
    border-radius: 100px;
    padding: 0.5rem;
  }

  .search-bar input {
    border-radius: 100px;
    font-size: 1rem;
    padding: 0.75rem;
  }

  .search-bar button {
    width: 20%;
    border-radius: 100;
    font-size: 1rem;
    padding: 0.75rem;
  }



  .search-bar button.loading {
    width: 40%;
  }

  .result-box {
    padding: 0rem;
  }

  .tooltip-text {
    visibility: hidden;
    opacity: 0;
    background-color: #2978ffcf;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    position: absolute;
    bottom: 0%;
    left: 0%;
    /* shift to the right of icon */
    transform: translateY(-50%);
    z-index: 10;
    font-size: 16px;
    width: 240px;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    transition: opacity 0.2s;
  }

  .ip-result-table td:first-child {
    width: 30%;
  }

  .ip-result-table td:last-child {
    width: 70%;
  }


  .tagline {
    font-size: 14px;
    color: gray;
    margin-top: 0.5rem;
    text-align: left;
  }

  .result-box th {
    font-size: 12pt;
  }

  .result-box td {
    font-size: 12pt;
  }

  .ping-table th,
  .ping-table td {
    font-size: 12px;
    padding: 0.5rem 0;
  }

  .carrier-badge {
    font-size: 10px;
    padding: 1px 4px;
  }

}
