/**
 * Scan results page styles.
 * Used by /{lang}/scan/ — standalone compliance scanner.
 */

/* ── Page layout ── */
.scan-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ── Hero section ── */
.scan-hero {
  text-align: center;
  padding: 60px 0 40px;
}
.scan-hero-inner {
  max-width: 640px;
  margin: 0 auto;
}
.scan-hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text-primary, #1f2937);
}
.scan-hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 28px;
  line-height: 1.5;
}
.scan-hero-input {
  max-width: 520px;
  margin: 0 auto 12px;
}
.scan-hero-hint {
  font-size: 13px;
  color: var(--text-secondary, #94a3b8);
  margin: 0;
}

/* ── Loading state (radar animation) ── */
.scan-loading {
  text-align: center;
  padding: 80px 16px 40px;
}
.scan-radar {
  width: 160px;
  height: 160px;
  margin: 0 auto 20px;
  position: relative;
}
.scan-radar-svg {
  width: 100%;
  height: 100%;
}
.scan-ring {
  fill: none;
  stroke: var(--primary-color, #10b981);
  stroke-width: 1.5;
  opacity: 0.15;
  transform-origin: 100px 100px;
}
.scan-ring-1 { animation: scanPulse 2.4s ease-out infinite; }
.scan-ring-2 { animation: scanPulse 2.4s ease-out 0.4s infinite; }
.scan-ring-3 { animation: scanPulse 2.4s ease-out 0.8s infinite; }
.scan-core {
  fill: rgba(16, 185, 129, 0.12);
  stroke: var(--primary-color, #10b981);
  stroke-width: 2;
  animation: scanCoreGlow 2s ease-in-out infinite;
  transform-origin: 100px 100px;
}
.scan-icon-shield {
  color: var(--primary-color, #10b981);
}

@keyframes scanPulse {
  0% { transform: scale(0.85); opacity: 0.3; stroke-width: 2; }
  100% { transform: scale(1.1); opacity: 0; stroke-width: 0.5; }
}
@keyframes scanCoreGlow {
  0%, 100% { fill: rgba(16, 185, 129, 0.1); }
  50% { fill: rgba(16, 185, 129, 0.25); }
}

.scan-progress-bar {
  width: 100%;
  max-width: 300px;
  height: 4px;
  background: var(--border-color, #e2e8f0);
  border-radius: 2px;
  margin: 0 auto 14px;
  overflow: hidden;
}
.scan-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 2px;
  transition: width 0.5s ease;
  position: relative;
}
.scan-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  animation: scanShimmer 1.5s ease-in-out infinite;
}
@keyframes scanShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.scan-status-msg {
  font-size: 14px;
  color: var(--text-secondary, #6b7280);
  margin: 0;
  min-height: 20px;
  transition: opacity 0.3s;
}

/* ── Error state ── */
.scan-error {
  text-align: center;
  padding: 80px 20px 40px;
}
.scan-error-inner {
  max-width: 400px;
  margin: 0 auto;
}
.scan-error-inner svg {
  margin-bottom: 16px;
}
.scan-error-msg {
  font-size: 1rem;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 24px;
}

/* ── Results section ── */
.scan-results {
  animation: scanFadeIn 0.5s ease-out;
}
@keyframes scanFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.scan-results-inner {
  max-width: 900px;
  margin: 0 auto;
}

/* ── Score gauge ── */
.scan-score-section {
  text-align: center;
  padding: 40px 0 24px;
}
.scan-score-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
  margin-bottom: 8px;
}
.scan-gauge-wrap {
  max-width: 240px;
  margin: 0 auto 8px;
}
.scan-gauge-svg {
  width: 100%;
  height: auto;
}
.scan-gauge-svg text[font-size="36"] {
  fill: var(--text-primary, #1f2937);
}
.scan-risk-comment {
  font-size: 0.9rem;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 4px;
}
.scan-domain-label {
  font-size: 0.85rem;
  color: var(--text-muted, #94a3b8);
  margin: 0;
  font-family: monospace;
}

/* ── 5 Pillars ── */
.scan-pillars {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0 32px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  margin-bottom: 32px;
}
.scan-pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--card-background, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  min-width: 120px;
  flex: 1;
  max-width: 180px;
  transition: border-color 0.3s;
}
.scan-pillar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.scan-pillar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  text-align: center;
  line-height: 1.3;
}
.scan-pillar-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}
.scan-pillar-pass { background: #16a34a; }
.scan-pillar-warn { background: #d97706; }
.scan-pillar-fail { background: #dc2626; }

/* ── Two-column details ── */
.scan-details {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

.scan-section-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color, #e2e8f0);
}
.scan-section-issues {
  border-bottom-color: #fecaca;
}
.scan-section-ok {
  margin-top: 24px;
  border-bottom-color: #bbf7d0;
}

/* ── Checklist items (accordions) ── */
.scan-accordion {
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.scan-accordion:last-child { border-bottom: none; }
.scan-accordion-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.scan-accordion-header::-webkit-details-marker { display: none; }
.scan-accordion-header::marker { content: ''; }
.scan-accordion-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.scan-accordion-title {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}
.scan-accordion-chevron {
  flex-shrink: 0;
  transition: transform 0.2s;
  color: var(--text-secondary, #94a3b8);
}
.scan-accordion[open] .scan-accordion-chevron {
  transform: rotate(180deg);
}
.scan-accordion-body {
  padding: 0 0 12px 28px;
  font-size: 0.85rem;
  color: var(--text-secondary, #6b7280);
  line-height: 1.6;
}
.scan-accordion-body a {
  color: #10b981;
  font-weight: 600;
}

/* Simple check items (no accordion, just icon + text) */
.scan-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.scan-check-item .scan-accordion-title {
  cursor: default;
}

.scan-no-issues {
  padding: 12px 0;
  font-weight: 600;
}

/* ── Detected data sidebar ── */
.scan-details-right {
  position: sticky;
  top: 80px;
}
.scan-detected-data {
  background: var(--card-background, #f8fafc);
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  overflow: hidden;
}
.scan-data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  gap: 8px;
}
.scan-data-row:last-child { border-bottom: none; }
.scan-data-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  white-space: nowrap;
}
.scan-data-value {
  font-size: 0.8rem;
  color: var(--text-primary, #1f2937);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.scan-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 10px;
  line-height: 1.4;
}

/* ── CTAs ── */
.scan-ctas {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 40px 0 20px;
  border-top: 1px solid var(--border-color, #e2e8f0);
  margin-top: 40px;
}
.scan-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.scan-cta-btn.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-secondary, #6b7280);
}
.scan-cta-btn.btn-ghost:hover {
  border-color: var(--primary-color, #10b981);
  color: var(--primary-color, #10b981);
}

/* ── Dark mode ── */
:root.dark-theme .scan-hero-title,
:root.dark-theme .scan-score-title {
  color: #f1f5f9;
}
:root.dark-theme .scan-pillar {
  background: #1e293b;
  border-color: #334155;
}
:root.dark-theme .scan-detected-data {
  background: #1e293b;
  border-color: #334155;
}
:root.dark-theme .scan-data-row {
  border-color: #334155;
}
:root.dark-theme .scan-data-value {
  color: #e5e7eb;
}
:root.dark-theme .scan-accordion {
  border-color: #374151;
}
:root.dark-theme .scan-accordion-body {
  color: #9ca3af;
}
:root.dark-theme .scan-gauge-svg text[font-size="36"] {
  fill: #f1f5f9;
}
:root.dark-theme .scan-ring {
  stroke: var(--primary-color, #10b981);
}
:root.dark-theme .scan-progress-bar {
  background: #1e293b;
}
:root.dark-theme .scan-status-msg {
  color: #94a3b8;
}
:root.dark-theme .scan-pillars,
:root.dark-theme .scan-ctas {
  border-color: #334155;
}
:root.dark-theme .scan-section-heading {
  color: #f1f5f9;
  border-bottom-color: #334155;
}
:root.dark-theme .scan-section-issues {
  border-bottom-color: #7f1d1d;
}
:root.dark-theme .scan-section-ok {
  border-bottom-color: #14532d;
}
:root.dark-theme .scan-cta-btn.btn-ghost {
  border-color: #334155;
  color: #94a3b8;
}
:root.dark-theme .scan-accordion-title[style*="#dc2626"] { color: #f87171 !important; }
:root.dark-theme .scan-accordion-title[style*="#d97706"] { color: #fbbf24 !important; }
:root.dark-theme .scan-accordion-title[style*="#2563eb"] { color: #93c5fd !important; }
:root.dark-theme .scan-accordion-title[style*="#16a34a"] { color: #6ee7b7 !important; }

/* ── Mobile responsive ── */
@media (max-width: 768px) {
  .scan-hero {
    padding: 40px 0 24px;
  }
  .scan-hero-title {
    font-size: 1.6rem;
  }
  .scan-details {
    grid-template-columns: 1fr;
  }
  .scan-details-right {
    position: static;
  }
  .scan-pillars {
    gap: 6px;
  }
  .scan-pillar {
    min-width: 80px;
    padding: 10px 8px;
  }
  .scan-pillar-label {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .scan-hero-title {
    font-size: 1.35rem;
  }
  .scan-pillars {
    flex-wrap: wrap;
  }
  .scan-pillar {
    min-width: 100px;
    flex: 1 1 calc(50% - 4px);
    max-width: none;
  }
  .scan-ctas {
    flex-direction: column;
    align-items: stretch;
  }
  .scan-cta-btn {
    justify-content: center;
  }
  .scan-radar {
    width: 130px;
    height: 130px;
  }
  .scan-progress-bar {
    max-width: 240px;
  }
  .scan-loading {
    padding: 50px 16px 40px;
  }
}
