/* VPN Checker Styling (Mobile-first, responsive, dark theme) */

.vpn-container {
  max-width: 680px;
}

/* Input Card */
.vpn-input-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vpn-detected-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-left: auto;
  transition: all 0.2s ease;
}

.vpn-detected-badge.detected {
  background: rgba(56, 139, 253, 0.15);
  color: #58a6ff;
  border-color: rgba(56, 139, 253, 0.35);
}

.vpn-textarea {
  width: 100%;
  min-height: 120px;
  max-height: 280px;
  padding: 12px 14px;
  background: rgba(13, 17, 23, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.86rem;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vpn-textarea:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.2);
}

/* Security Notice */
.vpn-security-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(56, 139, 253, 0.07);
  border: 1px solid rgba(56, 139, 253, 0.18);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.vpn-security-notice .notice-icon {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.vpn-security-notice strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

/* Progress Tracker */
.vpn-progress-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.progress-status-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spinner-small {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #58a6ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.progress-status-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Progress Bar & Live Status Tracker */
.vpn-progress-bar-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0;
}

.vpn-progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.vpn-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.vpn-progress-percent-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #60a5fa;
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
}

/* Live Terminal Log */
.vpn-terminal-log {
  background: rgba(10, 14, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #cbd5e1;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.vpn-log-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.vpn-log-time {
  color: #64748b;
  font-size: 0.74rem;
  flex-shrink: 0;
}

.vpn-log-text {
  color: #e2e8f0;
  word-break: break-word;
}

.vpn-log-line.success .vpn-log-text {
  color: #34d399;
  font-weight: 600;
}

.vpn-log-line.error .vpn-log-text {
  color: #f87171;
  font-weight: 600;
}

.vpn-log-line.info .vpn-log-text {
  color: #93c5fd;
}

.progress-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.progress-step-item .step-bullet {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.progress-step-item.active {
  color: #58a6ff;
  font-weight: 600;
}

.progress-step-item.active .step-bullet {
  background: #1f6feb;
  color: #ffffff;
}

.progress-step-item.done {
  color: #3fb950;
}

.progress-step-item.done .step-bullet {
  background: rgba(63, 185, 80, 0.2);
  color: #3fb950;
}

/* Risk Gauge Banner (matching dark terminal reference) */
.risk-gauge-banner {
  background: #080c0a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px 20px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  transition: border-color 0.3s ease;
}

.risk-gauge-banner.risk-low {
  border-color: rgba(34, 197, 94, 0.35);
}

.risk-gauge-banner.risk-medium {
  border-color: rgba(234, 179, 8, 0.35);
}

.risk-gauge-banner.risk-high {
  border-color: rgba(249, 115, 22, 0.35);
}

.risk-gauge-banner.risk-critical {
  border-color: rgba(239, 68, 68, 0.45);
}

.gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.gauge-status-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.gauge-status-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
  transition: color 0.3s ease;
}

.risk-gauge-banner.risk-low .gauge-status-title {
  color: #22c55e;
  text-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

.risk-gauge-banner.risk-medium .gauge-status-title {
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(234, 179, 8, 0.3);
}

.risk-gauge-banner.risk-high .gauge-status-title {
  color: #f97316;
  text-shadow: 0 0 12px rgba(249, 115, 22, 0.3);
}

.risk-gauge-banner.risk-critical .gauge-status-title {
  color: #ef4444;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.gauge-status-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84rem;
  color: #8b949e;
}

.gauge-proto-tag {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 7px;
  border-radius: 4px;
  color: #e6edf3;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
}

.gauge-metric-bullet {
  color: #484f58;
}

.gauge-score-metric {
  color: #8b949e;
}

.gauge-score-metric strong {
  color: #f0f6fc;
}

.gauge-target-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #8b949e;
  background: transparent;
  padding: 0;
  border: none;
}

.gauge-target-label {
  color: #6e7681;
}

.gauge-target-value {
  color: #cbd5e1;
  font-weight: 500;
}

/* Track and Segments */
.gauge-track-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.gauge-track {
  position: relative;
  height: 14px;
  display: flex;
  width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.gauge-segment {
  height: 100%;
  transition: opacity 0.2s ease;
}

.gauge-segment:first-child {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}

.gauge-segment:last-child {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}

.gauge-seg-green {
  background: #22c55e;
}

.gauge-seg-yellow {
  background: #fbbf24;
}

.gauge-seg-orange {
  background: #f97316;
}

.gauge-seg-red {
  background: #ef4444;
}

/* Floating Marker Pin */
.gauge-marker {
  position: absolute;
  top: -20px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
}

.gauge-marker-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
  white-space: nowrap;
  line-height: 1.1;
  margin-bottom: 2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.gauge-marker-pin {
  width: 2px;
  height: 22px;
  background: #ffffff;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.85);
  border-radius: 1px;
}

/* Labels below Track */
.gauge-labels-row {
  display: flex;
  width: 100%;
  margin-top: 6px;
}

.gauge-label-col {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  color: #6e7681;
  text-align: center;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}

@media (max-width: 480px) {
  .gauge-status-title {
    font-size: 1.15rem;
  }
  .gauge-label-col {
    font-size: 0.58rem;
    letter-spacing: 0;
  }
  .risk-gauge-banner {
    padding: 14px 14px 16px;
  }
}

/* Legacy Score Summary Banner fallback */
.score-summary-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(22, 27, 34, 0.95) 0%, rgba(13, 17, 23, 0.95) 100%);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 18px;
}

.score-circle-container {
  display: flex;
  align-items: baseline;
  justify-content: center;
  min-width: 90px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.score-value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
}

.score-max {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-left: 4px;
}

.score-meta-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.risk-badge.low {
  background: rgba(46, 160, 67, 0.18);
  color: #3fb950;
  border: 1px solid rgba(46, 160, 67, 0.4);
}

.risk-badge.medium {
  background: rgba(210, 153, 34, 0.18);
  color: #d29922;
  border: 1px solid rgba(210, 153, 34, 0.4);
}

.risk-badge.high {
  background: rgba(248, 81, 73, 0.18);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.4);
}

.risk-badge.critical {
  background: rgba(239, 68, 68, 0.22);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.server-endpoint-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.proto-tag {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--text-primary);
}

.endpoint-tag {
  color: var(--text-secondary);
}

/* Baskets List */
.vpn-baskets-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.basket-block {
  background: rgba(13, 17, 23, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.basket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.basket-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.basket-penalty-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.basket-penalty-badge.penalized {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.basket-items-list {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.check-item-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.check-item-row:last-child {
  border-bottom: none;
}

.check-item-icon {
  font-size: 1.05rem;
  line-height: 1.3;
  flex-shrink: 0;
}

.check-item-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.check-item-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
}

.item-penalty-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f85149;
}

.item-penalty-tag.zero {
  color: #3fb950;
}

.check-item-fact {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Fixes Spoiler */
.vpn-fixes-container {
  margin-bottom: 22px;
}

.vpn-fixes-spoiler {
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid rgba(56, 139, 253, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
}

.vpn-fixes-spoiler summary {
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  color: #58a6ff;
  outline: none;
  list-style: none;
}

.vpn-fixes-spoiler summary::-webkit-details-marker {
  display: none;
}

.fixes-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.fix-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.fix-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  color: var(--text-primary);
}

.fix-gain-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(46, 160, 67, 0.2);
  color: #3fb950;
  border: 1px solid rgba(46, 160, 67, 0.4);
}

/* Action Buttons */
.results-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.results-secondary-actions {
  display: flex;
  gap: 10px;
}

.results-secondary-actions .btn {
  flex: 1;
}

/* Error Card */
.vpn-error-card {
  border-color: rgba(248, 81, 73, 0.4);
  background: rgba(248, 81, 73, 0.08);
  padding: 18px;
}

.error-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.error-icon {
  font-size: 1.2rem;
}

.error-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f85149;
}

.error-message-text {
  font-size: 0.86rem;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: 12px;
}

.error-hint-box {
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.28);
  border-left: 3px solid #58a6ff;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.error-hint-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.error-hint-icon {
  font-size: 1rem;
}

.error-hint-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #79c0ff;
  letter-spacing: 0.3px;
}

.error-hint-text {
  font-size: 0.84rem;
  color: #c9d1d9;
  line-height: 1.5;
  margin: 0;
}

.error-actions-row {
  display: flex;
  gap: 10px;
}

/* Toast */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(22, 27, 34, 0.95);
  border: 1px solid #58a6ff;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  transition: opacity 0.3s ease;
}

/* Helper Utilities */
.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .score-summary-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .results-secondary-actions {
    flex-direction: column;
  }
}

