:root {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --bg-code: #f5f5f5;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #e5e5e5;
  --accent: #0066cc;
  --danger: #dc3545;
  --success: #28a745;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Header */
header {
  margin-bottom: 2.5rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--danger);
  color: white;
  border-radius: 3px;
}

/* Scanner Section */
.scanner-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.scanner-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* Form */
.input-group {
  display: flex;
  gap: 0.5rem;
}

input[type="url"] {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  outline: none;
}

input[type="url"]:focus {
  border-color: var(--accent);
}

input[type="url"]::placeholder {
  color: var(--text-muted);
}

button {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  opacity: 0.9;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Progress */
.scan-progress {
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 6px;
}

.progress-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
  color: var(--accent);
}

.progress-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.step-icon {
  font-size: 0.7rem;
}

.step.active {
  color: var(--accent);
}

.step.done {
  color: var(--success);
}

.step.error {
  color: var(--danger);
}

/* Results */
.result-container {
  margin-top: 1.5rem;
}

.status-section {
  padding: 1rem;
  background: var(--bg);
  border-radius: 6px;
  margin-bottom: 1rem;
}

.status-section.status-vulnerable {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.status-section.status-vulnerable .status-icon,
.status-section.status-vulnerable .status-text {
  color: var(--danger);
}

.status-section.status-safe {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.status-section.status-safe .status-icon,
.status-section.status-safe .status-text {
  color: var(--success);
}

.status-section.status-unknown {
  background: #fefce8;
  border: 1px solid #fef08a;
}

.status-section.status-unknown .status-icon,
.status-section.status-unknown .status-text {
  color: #a16207;
}

.status-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-icon {
  font-size: 1.25rem;
}

.status-text {
  font-weight: 500;
}

/* Data Section */
.data-section {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.data-grid {
  padding: 0.75rem 1rem;
}

.data-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.9rem;
}

.data-label {
  color: var(--text-secondary);
}

.data-value {
  font-family: 'SF Mono', Monaco, monospace;
  color: var(--text);
  text-align: right;
  word-break: break-all;
}

.status-code[data-code^="5"] {
  color: var(--danger);
  font-weight: 500;
}

/* Response Body */
.response-body-section {
  border-top: 1px solid var(--border);
}

.response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg);
}

.section-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.response-size {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

.response-header .copy-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.response-header .copy-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.response-body {
  margin: 0;
  padding: 1rem;
  background: var(--bg-code);
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  overflow: auto;
  max-height: 250px;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
}

/* Indicators */
.indicators-section {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.indicators-grid {
  padding: 0.5rem;
}

.indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.indicator-checkbox {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.indicator.checked .indicator-checkbox {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.indicator.checked .indicator-checkbox::after {
  content: '✓';
}

.indicator.checked .indicator-label {
  color: var(--text);
}

/* Interpretation Guide */
.interpretation-guide {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.guide-header {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
}

.guide-header::-webkit-details-marker {
  display: none;
}

.guide-header::after {
  content: '+';
  font-size: 1rem;
  color: var(--text-muted);
}

details[open] .guide-header::after {
  content: '-';
}

.guide-content {
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.guide-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.guide-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.guide-item h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.guide-item p {
  margin-bottom: 0.5rem;
}

.guide-item code {
  background: var(--bg-code);
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
  font-size: 0.8rem;
}

.guide-item ul {
  margin-top: 0.5rem;
  padding-left: 1.25rem;
}

.guide-item li {
  margin-bottom: 0.25rem;
}

.guide-item.important {
  background: #fff8e6;
  padding: 0.75rem;
  border-radius: 4px;
  border: none;
}

.guide-item.important h4 {
  color: #b45309;
}

/* Info Section */
.info-section {
  margin-top: 3rem;
}

.info-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.info-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.info-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.info-card code {
  display: block;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-code);
  border-radius: 4px;
  font-size: 0.8rem;
  overflow-x: auto;
}

/* Versions Card */
.versions-card summary {
  list-style: none;
  cursor: pointer;
}

.versions-card summary::-webkit-details-marker {
  display: none;
}

.versions-card summary h3::after {
  content: ' +';
  color: var(--text-muted);
  font-weight: normal;
}

.versions-card[open] summary h3::after {
  content: ' -';
}

.versions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.75rem;
}

.version-group h4 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.version-group ul {
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.version-group li {
  padding: 0.15rem 0;
}

.patch {
  color: var(--success);
  font-size: 0.75rem;
}

/* Mitigation */
.info-card.mitigation {
  border-left: 3px solid var(--success);
}

.mitigation-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mitigation-item {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.mitigation-number {
  width: 20px;
  height: 20px;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
}

.mitigation-item strong {
  display: block;
  margin-bottom: 0.15rem;
}

.mitigation-item p {
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

/* Footer */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.footer-links {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
}

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

.footer-links span {
  margin: 0 0.5rem;
  color: var(--text-muted);
}

.disclaimer {
  background: #fff8e6;
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.credits a {
  color: var(--accent);
  text-decoration: none;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 1.5rem 1rem;
  }

  .input-group {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .data-row {
    flex-direction: column;
    gap: 0.1rem;
  }

  .data-value {
    text-align: left;
  }

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