/* =============================================
   IPTV Speed Test — WordPress Plugin Stylesheet
   iptvinformation.com
   ============================================= */

.iptv-speed-test-wrap {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0 auto;
  max-width: 820px;
  padding: 8px;
}

/* ---- Container ---- */
.ist-container {
  background: linear-gradient(145deg, #0a0f1e 0%, #0d1b2a 60%, #0a1628 100%);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 20px;
  padding: 36px 28px 28px;
  box-shadow: 0 0 60px rgba(99,102,241,0.12), 0 20px 60px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}

.ist-container::before {
  content: '';
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 400px; height: 400px;
  background: radial-gradient(ellipse, rgba(99,102,241,0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* ---- Header ---- */
.ist-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

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

.ist-logo-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 8px rgba(99,102,241,0.8));
}

.ist-logo-title {
  font-size: 20px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.3px;
}

.ist-logo-sub {
  font-size: 12px;
  color: #6366f1;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ---- Gauge ---- */
.ist-gauge-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 0 auto 8px;
  max-width: 300px;
}

.ist-gauge-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 12px rgba(99,102,241,0.3));
}

.ist-speed-display {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
}

.ist-speed-value {
  font-size: 52px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px rgba(99,102,241,0.6);
  transition: all 0.3s ease;
}

.ist-speed-unit {
  font-size: 13px;
  color: #6366f1;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 600;
}

.ist-speed-label {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* ---- Start Button ---- */
.ist-btn-wrap {
  display: flex;
  justify-content: center;
  margin: 20px 0 28px;
}

.ist-btn {
  position: relative;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  border: none;
  border-radius: 50px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 16px 48px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-shadow: 0 0 30px rgba(99,102,241,0.4), 0 4px 20px rgba(0,0,0,0.3);
  overflow: hidden;
}

.ist-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(99,102,241,0.6), 0 8px 30px rgba(0,0,0,0.4);
}

.ist-btn:active:not(:disabled) {
  transform: translateY(0);
}

.ist-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.ist-btn-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0);
  width: 100%; height: 100%;
  border-radius: 50px;
  border: 2px solid rgba(255,255,255,0.4);
  opacity: 0;
  animation: none;
}

.ist-btn.testing .ist-btn-ring {
  animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { transform: translate(-50%,-50%) scale(0.8); opacity: 0.8; }
  100% { transform: translate(-50%,-50%) scale(1.6); opacity: 0; }
}

/* ---- Results Cards ---- */
.ist-results {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .ist-results { grid-template-columns: repeat(2, 1fr); }
}

.ist-result-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px 12px 14px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ist-result-card.active {
  border-color: rgba(99,102,241,0.4);
  background: rgba(99,102,241,0.08);
  box-shadow: 0 0 20px rgba(99,102,241,0.15);
}

.ist-result-card.done {
  border-color: rgba(16,185,129,0.35);
  background: rgba(16,185,129,0.06);
}

.ist-result-icon {
  font-size: 20px;
  margin-bottom: 8px;
}

.ist-result-value {
  font-size: 26px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-height: 30px;
}

.ist-result-label {
  font-size: 9px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: 6px;
  font-weight: 600;
}

.ist-result-bar {
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  height: 4px;
  margin-top: 10px;
  overflow: hidden;
}

.ist-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, #6366f1, #06b6d4);
  transition: width 0.6s ease;
}

/* ---- Status Bar ---- */
.ist-status-bar {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.ist-status-text {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  letter-spacing: 0.3px;
}

.ist-status-text.running {
  color: #6366f1;
}

.ist-status-text.done {
  color: #10b981;
}

/* ---- IPTV Tip ---- */
.ist-iptv-tip {
  background: linear-gradient(135deg, rgba(6,182,212,0.1), rgba(99,102,241,0.1));
  border: 1px solid rgba(6,182,212,0.3);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.ist-tip-icon { font-size: 22px; flex-shrink: 0; }

.ist-tip-text {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.6;
}

.ist-tip-text strong { color: #e2e8f0; }

/* ---- Footer ---- */
.ist-footer {
  text-align: center;
  font-size: 11px;
  color: #334155;
  padding-top: 4px;
}

.ist-footer a {
  color: #6366f1;
  text-decoration: none;
}

.ist-footer a:hover { text-decoration: underline; }

/* ---- Light theme ---- */
.iptv-speed-test-wrap[data-theme="light"] .ist-container {
  background: linear-gradient(145deg, #f8fafc, #f1f5f9);
  border-color: rgba(99,102,241,0.2);
  box-shadow: 0 4px 40px rgba(0,0,0,0.08);
}

.iptv-speed-test-wrap[data-theme="light"] .ist-logo-title { color: #0f172a; }
.iptv-speed-test-wrap[data-theme="light"] .ist-speed-value { color: #0f172a; text-shadow: none; }
.iptv-speed-test-wrap[data-theme="light"] .ist-result-card { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); }
.iptv-speed-test-wrap[data-theme="light"] .ist-result-value { color: #0f172a; }
.iptv-speed-test-wrap[data-theme="light"] .ist-result-label { color: #94a3b8; }
.iptv-speed-test-wrap[data-theme="light"] .ist-status-bar { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.06); }
.iptv-speed-test-wrap[data-theme="light"] .ist-status-text { color: #64748b; }
.iptv-speed-test-wrap[data-theme="light"] .ist-footer { color: #94a3b8; }
.iptv-speed-test-wrap[data-theme="light"] .ist-gauge-svg path[stroke="#1e293b"] { stroke: #e2e8f0; }
