/* =====================================
           CONTENT
        ===================================== */

.content {
  padding: 30px 32px 45px;
  max-width: 1500px;
  margin: auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 11px;
}

.breadcrumb svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.breadcrumb .current {
  color: var(--blue);
  font-weight: 600;
}

/* =====================================
           SPEED HERO
        ===================================== */

.speed-hero {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #0f5ff1 0%, #1769ff 50%, #08afd5 100%);
  color: white;
  box-shadow: 0 12px 35px rgba(23, 105, 255, 0.18);
  margin-bottom: 22px;
}

.speed-hero::before {
  content: "";
  position: absolute;
  width: 330px;
  height: 330px;
  border: 50px solid rgba(255, 255, 255, 0.045);
  border-radius: 50%;
  right: -100px;
  top: -170px;
}

.speed-hero::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  border: 40px solid rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  right: 210px;
  bottom: -170px;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.hero-left {
  max-width: 650px;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 13px;
}

.hero-label svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.hero-title {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 8px;
}

.hero-description {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  line-height: 1.7;
}

.connection-status {
  min-width: 230px;
  padding: 17px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
}

.status-top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #48e6a5;
  box-shadow: 0 0 0 5px rgba(72, 230, 165, 0.12);
}

.status-top strong {
  font-size: 11px;
}

.connection-status span {
  display: block;
  color: rgba(255, 255, 255, 0.63);
  font-size: 9px;
}

/* =====================================
           SPEED TEST CARD
        ===================================== */

.speed-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  min-height: 67px;
  padding: 18px 21px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 11px;
}

.card-icon {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  background: #edf4ff;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.card-title h2 {
  font-size: 13px;
  font-weight: 750;
}

.card-title p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.card-body {
  padding: 21px;
}

/* =====================================
           TEST AREA
        ===================================== */

.test-area {
  min-height: 355px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.speed-circle {
  position: relative;
  width: 205px;
  height: 205px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center, white 0 63%, transparent 64%),
    conic-gradient(
      var(--blue) 0deg,
      var(--cyan) 260deg,
      #eaf0f7 260deg,
      #eaf0f7 360deg
    );
  margin-bottom: 23px;
}

.speed-circle::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px dashed #dce5f0;
}

.speed-value {
  position: relative;
  z-index: 2;
}

.speed-number {
  display: block;
  font-size: 40px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -1.8px;
  color: var(--text);
}

.speed-unit {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.test-status {
  min-height: 17px;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 14px;
}

.test-button {
  height: 44px;
  min-width: 175px;
  padding: 0 22px;
  border: none;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue), #0e58df);
  color: white;
  font-size: 11px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(23, 105, 255, 0.18);
  transition: 0.2s ease;
}

.test-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(23, 105, 255, 0.24);
}

.test-button:disabled {
  opacity: 0.75;
  cursor: wait;
  transform: none;
}

.test-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.test-button.loading svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.server-info {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

.server-info svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* =====================================
           METRICS
        ===================================== */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
}

.metric {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fbfcfe;
}

.metric-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.metric-icon {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #edf4ff;
  color: var(--blue);
}

.metric-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.metric-top span {
  color: var(--muted);
  font-size: 9px;
}

.metric-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.metric-value small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
}

.metric-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.quality-box {
  margin-top: 13px;
  padding: 15px;
  border-radius: 13px;
  background: #f5fbf8;
  border: 1px solid #dff4eb;
}

.quality-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.quality-head strong {
  font-size: 10px;
}

.quality-head span {
  font-size: 9px;
  color: var(--green);
  font-weight: 700;
}

.quality-bar {
  width: 100%;
  height: 7px;
  border-radius: 10px;
  background: #e6f2ed;
  overflow: hidden;
}

.quality-fill {
  width: 97%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #40d89b);
}

.quality-box p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

/* =====================================
           HISTORY
        ===================================== */

.history-card {
  margin-top: 20px;
}

.history-table-wrapper {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th {
  padding: 12px 16px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.history-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
  font-size: 10px;
  vertical-align: middle;
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

.date {
  color: var(--muted);
}

.download-speed {
  color: var(--blue);
  font-weight: 700;
}

.upload-speed {
  color: var(--cyan);
  font-weight: 700;
}

.ping {
  font-weight: 650;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 20px;
  color: #119565;
  background: #e8fbf3;
  font-size: 8px;
  font-weight: 700;
}

.status-badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* =====================================
           INFO GRID
        ===================================== */

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.info-card {
  padding: 18px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.info-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 13px;
  background: #edf4ff;
  color: var(--blue);
}

.info-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.info-card strong {
  display: block;
  font-size: 11px;
  margin-bottom: 5px;
}

.info-card p {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

/* =====================================
           TOAST
        ===================================== */

.toast {
  position: fixed;
  right: 25px;
  bottom: 25px;
  padding: 13px 16px;
  border-radius: 12px;
  background: #182230;
  color: white;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
  transform: translateY(80px);
  opacity: 0;
  pointer-events: none;
  transition: 0.3s ease;
  z-index: 2000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* =====================================
           RESPONSIVE
        ===================================== */

@media (max-width: 1050px) {
  .speed-grid {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  :root {
    --sidebar: 0px;
  }

  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.12);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .mobile-menu {
    display: flex;
  }

  .topbar {
    padding: 0 18px;
  }

  .content {
    padding: 22px 18px 35px;
  }

  .hero-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .connection-status {
    width: 100%;
  }

  .user-info {
    display: none;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .top-actions {
    gap: 8px;
  }

  .page-heading p {
    display: none;
  }

  .page-heading h1 {
    font-size: 16px;
  }

  .speed-hero {
    padding: 22px;
  }

  .hero-title {
    font-size: 22px;
  }

  .card-header {
    padding: 16px;
  }

  .card-body {
    padding: 16px;
  }

  .test-area {
    min-height: 330px;
  }

  .speed-circle {
    width: 185px;
    height: 185px;
  }

  .speed-number {
    font-size: 35px;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .history-table {
    min-width: 680px;
  }
}
