/**
 * WH DIGITAL — Interactive Audit Tools Stylesheet
 * Brand: wh.com.tr
 * Features: Animated SVG score gauges, circular meters, scanning pulse, category tabs & print export
 */

:root {
  --color-ink: #0a0a0a;
  --color-ink-dim: #27272a;
  --color-muted: #52525b;
  --color-border: #e5e7eb;
  --color-border-strong: #cbd5e1;
  --color-bg-soft: #f5f4f1;
  --color-primary: #0066ff;
  --color-primary-soft: rgba(0, 102, 255, 0.08);
  --color-accent-2: #ff7a59;
}

/* Color utilities matching arbitrary template classes */
.text-\[var\(--color-ink\)\] { color: #0a0a0a !important; }
.text-\[var\(--color-ink-dim\)\] { color: #27272a !important; }
.text-\[var\(--color-muted\)\] { color: #52525b !important; }
.text-\[var\(--color-primary\)\] { color: #0066ff !important; }

.bg-\[var\(--color-ink\)\] { background-color: #0a0a0a !important; }
.bg-\[var\(--color-bg-soft\)\] { background-color: #f5f4f1 !important; }
.bg-\[var\(--color-primary\)\] { background-color: #0066ff !important; }

.border-\[var\(--color-border\)\] { border-color: #e5e7eb !important; }
.border-\[var\(--color-border-strong\)\] { border-color: #cbd5e1 !important; }

/* Enforce high readability on tools inputs and check items */
.tool-input-card,
.check-item-card,
.priority-fixes-panel,
.scan-progress-panel {
  background-color: #ffffff !important;
  color: #0a0a0a !important;
}

.check-item-card .check-title {
  color: #0a0a0a !important;
  font-weight: 600 !important;
}

.check-item-card .check-detail-text {
  color: #52525b !important;
}

.check-item-card .check-value-tag {
  background-color: #f5f4f1 !important;
  color: #18181b !important;
  border: 1px solid #e4e4e7 !important;
}

.check-item-card .check-why-box {
  background-color: #f5f4f1 !important;
  color: #3f3f46 !important;
  border: 1px solid #e4e4e7 !important;
}

.check-item-card .check-why-label {
  color: #0a0a0a !important;
  font-weight: 600 !important;
}

/* Dark banners high contrast */
.tool-score-banner,
.scorecard-banner {
  background-color: #0a0a0a !important;
  color: #ffffff !important;
}

.tool-score-banner h3,
.scorecard-banner h3,
.tool-score-banner .text-xl,
.scorecard-banner .text-xl {
  color: #ffffff !important;
}

.tool-score-banner p,
.scorecard-banner p {
  color: rgba(255, 255, 255, 0.85) !important;
}

.tool-score-banner .timing-stat-card,
.scorecard-banner .timing-stat-card {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

.tool-score-banner .timing-stat-label,
.scorecard-banner .timing-stat-label {
  color: rgba(255, 255, 255, 0.75) !important;
}

.tool-score-banner .timing-stat-val,
.scorecard-banner .timing-stat-val {
  color: #ffffff !important;
}

/* =============================================================================
   1. Tools Hero & Scan Form
   ============================================================================= */
.tools-hero {
  padding-top: clamp(6.5rem, 12vw, 8.5rem);
  padding-bottom: clamp(3rem, 6vw, 4.5rem);
  background: var(--color-bg-soft);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

.tools-hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(60% 60% at 50% 0%, rgba(0, 102, 255, 0.08) 0%, rgba(0, 102, 255, 0) 70%),
              radial-gradient(40% 50% at 90% 20%, rgba(255, 179, 125, 0.12) 0%, rgba(255, 179, 125, 0) 70%);
}

.tool-input-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  margin-top: 2rem;
  position: relative;
}

.tool-input-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  padding: 0.375rem 0.5rem 0.375rem 1.25rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-input-pill:focus-within {
  border-color: var(--color-ink);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08);
  background: #ffffff;
}

.tool-input-field {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1rem;
  color: var(--color-ink);
  font-family: inherit;
}

.tool-input-field::placeholder {
  color: var(--color-muted);
}

@media (max-width: 639px) {
  .tool-input-card {
    padding: 1.15rem;
  }
  .tool-input-pill {
    flex-wrap: wrap;
    border-radius: 16px;
    padding: 0.75rem;
    gap: 0.65rem;
  }
  .tool-input-field {
    flex: 1 1 calc(100% - 2.5rem);
    min-width: 0;
    padding: 0.25rem 0;
    font-size: 0.95rem;
  }
  .tool-input-pill .btn-pill-primary {
    width: 100%;
    justify-content: center;
  }
}

.scan-mode-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.scan-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scan-mode-option.is-selected {
  border-color: var(--color-ink);
  background: var(--color-bg-soft);
  box-shadow: 0 0 0 2px var(--color-ink);
}

.scan-mode-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-bg-soft);
  color: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.scan-mode-option.is-selected .scan-mode-icon {
  background: var(--color-ink);
  color: #ffffff;
}

/* =============================================================================
   2. Audit Scan Pulse Animation & Live States
   ============================================================================= */
.scan-progress-panel {
  display: none;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin-top: 2rem;
  position: relative;
  overflow: hidden;
}

.scan-progress-panel.is-active {
  display: block;
}

.scan-radar {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-radar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  opacity: 0.8;
  animation: radarWave 2s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
}

.scan-radar-ring:nth-child(2) {
  animation-delay: 0.6s;
}

.scan-radar-ring:nth-child(3) {
  animation-delay: 1.2s;
}

@keyframes radarWave {
  0% {
    transform: scale(0.4);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.scan-spinner-icon {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 102, 255, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: toolSpin 0.8s linear infinite;
}

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

/* =============================================================================
   3. Results Scorecard Hero (Radial Gauge & Metrics)
   ============================================================================= */
.results-container {
  display: none;
  margin-top: 2.5rem;
}

.results-container.is-visible,
#seo-results-container.is-visible,
#geo-results-container.is-visible,
#social-results-container.is-visible {
  display: block !important;
}

#seo-progress-panel.is-active,
#geo-progress-panel.is-active,
#social-progress-panel.is-active {
  display: block !important;
}

.scorecard-banner,
.tool-score-banner,
.bg-\[var\(--color-dark-bg\)\] {
  background: #0a0a0a !important;
  background-color: #0a0a0a !important;
  color: #ffffff !important;
  border-radius: 24px;
  padding: 2rem 2.5rem;
  position: relative;
  overflow: hidden;
}

.scorecard-banner-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(70% 70% at 100% 0%, rgba(255, 179, 125, 0.22) 0%, transparent 65%),
              radial-gradient(60% 70% at 0% 100%, rgba(110, 168, 255, 0.25) 0%, transparent 70%);
}

.scorecard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .scorecard-grid {
    grid-template-columns: 280px 1fr;
    align-items: center;
  }
}

/* Radial Gauge Meter */
.gauge-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gauge-svg {
  transform: rotate(-90deg);
  overflow: visible;
}

.gauge-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
}

.gauge-progress {
  fill: none;
  stroke: url(#gauge-gradient);
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.gauge-center-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
}

.gauge-score-number {
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #6ea8ff, #b9a3ff 45%, #ffb37d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.grade-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

.grade-pill-A {
  background: #10b981;
  color: #ffffff;
}

.grade-pill-B {
  background: #3b82f6;
  color: #ffffff;
}

.grade-pill-C {
  background: #f59e0b;
  color: #ffffff;
}

.grade-pill-D {
  background: #f97316;
  color: #ffffff;
}

.grade-pill-F {
  background: #ef4444;
  color: #ffffff;
}

.timing-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.25rem;
}

@media (min-width: 640px) {
  .timing-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.timing-stat-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
}

.timing-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-mono, monospace);
}

.timing-stat-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 0.2rem;
}

/* =============================================================================
   4. Category Filter Tabs & Granular Accordions
   ============================================================================= */
.category-tabs-wrapper {
  margin-top: 2rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.category-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--color-bg-soft);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.category-tab-btn:hover {
  background: #ffffff;
  color: var(--color-ink);
  border-color: var(--color-border-strong);
}

.category-tab-btn.is-active {
  background: var(--color-ink);
  color: #ffffff;
  border-color: var(--color-ink);
}

.tab-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.06);
}

.category-tab-btn.is-active .tab-badge {
  background: rgba(255, 255, 255, 0.2);
}

/* Check Item Row Card */
.checks-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.check-item-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 1.15rem 1.4rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.check-item-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.check-item-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

.status-icon-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.status-badge-pass {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.status-badge-warn {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.status-badge-fail {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.status-badge-info {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.status-pill-mini {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  line-height: 1.2;
}

.check-title-group {
  min-width: 0;
}

.check-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-ink);
}

.check-detail-text {
  font-size: 0.83rem;
  color: var(--color-muted);
  margin-top: 0.2rem;
  line-height: 1.4;
}

.check-value-tag {
  font-size: 0.8rem;
  font-family: var(--font-mono, monospace);
  color: var(--color-ink-dim);
  background: var(--color-bg-soft);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
}

.check-why-box {
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg-soft);
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--color-muted);
  line-height: 1.45;
}

.check-why-label {
  font-weight: 600;
  color: var(--color-ink);
  margin-right: 0.35rem;
}

/* =============================================================================
   5. Priority Fixes / Issues Panel
   ============================================================================= */
.priority-fixes-panel {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.priority-fix-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.priority-fix-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* =============================================================================
   6. Export Actions & Print Styles
   ============================================================================= */
.export-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.btn-export-print {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-ink);
  background: #ffffff;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-export-print:hover {
  background: var(--color-bg-soft);
  border-color: var(--color-border-strong);
}

@media (max-width: 639px) {
  .scorecard-banner {
    padding: 1.5rem 1.25rem;
  }
  .check-item-header {
    grid-template-columns: auto 1fr;
    align-items: flex-start;
  }
  .check-value-tag {
    grid-column: 2;
    justify-self: start;
    white-space: normal;
    word-break: break-word;
  }
  .export-actions-row {
    flex-direction: column;
    align-items: stretch;
  }
  .export-actions-row > div {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }
  .export-actions-row > div > a {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .wh-header,
  .wh-footer,
  .cookie-toast,
  .tool-input-card,
  .export-actions-row,
  .category-tabs-wrapper {
    display: none !important;
  }
  .tools-hero {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
  }
  .results-container {
    display: block !important;
    margin: 0 !important;
  }
  .scorecard-banner {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    border-radius: 0 !important;
  }
  .timing-stat-card {
    border: 1px solid #ccc !important;
    color: #000000 !important;
  }
  .check-item-card {
    break-inside: avoid;
    border: 1px solid #e0e0e0 !important;
  }
}
