/* PhishGuard — styles
   Author: Abenezer | MIT License | 2026 */

:root {
  /* Color Palette */
  --bg-base: #060812;
  --bg-surface: #0d1117;
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.07);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.4);

  /* Brand */
  --indigo: #6366f1;
  --indigo-light: #818cf8;
  --cyan: #06b6d4;
  --cyan-light: #67e8f9;

  /* Risk Colors */
  --c-safe: #10b981;
  --c-safe-bg: rgba(16, 185, 129, 0.12);
  --c-safe-border: rgba(16, 185, 129, 0.35);
  --c-low: #22d3ee;
  --c-low-bg: rgba(34, 211, 238, 0.10);
  --c-medium: #f59e0b;
  --c-medium-bg: rgba(245, 158, 11, 0.12);
  --c-medium-border: rgba(245, 158, 11, 0.35);
  --c-high: #f97316;
  --c-high-bg: rgba(249, 115, 22, 0.12);
  --c-high-border: rgba(249, 115, 22, 0.35);
  --c-critical: #ef4444;
  --c-critical-bg: rgba(239, 68, 68, 0.12);
  --c-critical-border: rgba(239, 68, 68, 0.40);

  /* Typography */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: #e2e8f0;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* animated background */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 100%);
}

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbDrift 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
  top: -200px;
  left: -150px;
  animation-duration: 20s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.14) 0%, transparent 70%);
  top: 30%;
  right: -150px;
  animation-duration: 15s;
  animation-delay: -5s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.10) 0%, transparent 70%);
  bottom: -100px;
  left: 30%;
  animation-duration: 25s;
  animation-delay: -10s;
}

@keyframes orbDrift {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(40px, 30px) scale(1.08);
  }
}

/* layout */
.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* glassmorphism base */
.glass {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 0;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--indigo-light), var(--cyan-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-safe);
  letter-spacing: 0.02em;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-safe);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
  }
}

/* hero section */
.hero {
  text-align: center;
  padding: 64px 0 40px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #f1f5f9;
}

.gradient-text {
  background: linear-gradient(135deg, var(--indigo-light) 0%, var(--cyan) 50%, var(--cyan-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-sub {
  margin-top: 18px;
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.7;
}

/* URL input card */
.input-card {
  border-radius: var(--radius-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.1), 0 30px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: box-shadow 0.3s var(--ease-out);
}

.input-card:focus-within {
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4), 0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(99, 102, 241, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 0 14px;
  transition: border-color 0.25s, background 0.25s;
}

.input-wrapper:focus-within {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.input-icon {
  color: #475569;
  flex-shrink: 0;
}

.url-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: #e2e8f0;
  padding: 15px 12px;
  caret-color: var(--indigo-light);
}

.url-input::placeholder {
  color: #334155;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #475569;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
}

.clear-btn:hover {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
}

.analyze-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--indigo) 0%, #7c3aed 50%, var(--cyan) 100%);
  background-size: 200% 200%;
  animation: gradShift 4s ease infinite;
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.35);
  transition: box-shadow 0.3s, transform 0.2s;
}

.analyze-btn:hover:not(:disabled) {
  box-shadow: 0 8px 40px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

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

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

.analyze-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.analyze-btn:hover::before {
  opacity: 1;
}

@keyframes gradShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.btn-loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.analyze-btn.loading .btn-text,
.analyze-btn.loading .btn-icon {
  display: none;
}

.analyze-btn.loading .btn-loader {
  display: block;
}

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

/* example chips */
.quick-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.examples-label {
  font-size: 0.8rem;
  color: #475569;
  margin-right: 4px;
}

.example-chip {
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  font-family: var(--font-sans);
}

.example-chip.phish {
  color: var(--c-high);
  border-color: rgba(249, 115, 22, 0.3);
  background: rgba(249, 115, 22, 0.07);
}

.example-chip.phish:hover {
  background: rgba(249, 115, 22, 0.15);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.2);
  transform: translateY(-1px);
}

.example-chip.safe {
  color: var(--c-safe);
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.07);
}

.example-chip.safe:hover {
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}

/* results panel */
.results-panel {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.results-panel.hidden {
  display: none;
}

/* URL breakdown display */
.url-breakdown {
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.8;
  word-break: break-all;
  color: #64748b;
}

.url-bd-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #334155;
  margin-bottom: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
}

.url-bd-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.url-bd-part {
  border-radius: 4px;
  padding: 1px 5px;
}

.url-bd-scheme {
  color: var(--c-medium);
  background: rgba(245, 158, 11, 0.1);
}

.url-bd-scheme.secure {
  color: var(--c-safe);
  background: rgba(16, 185, 129, 0.1);
}

.url-bd-domain {
  color: var(--indigo-light);
  background: rgba(99, 102, 241, 0.1);
}

.url-bd-path {
  color: #64748b;
}

.url-bd-key {
  font-size: 0.7rem;
  color: #334155;
  font-family: var(--font-sans);
}

/* verdict row (score ring + badge) */
.verdict-row {
  display: flex;
  align-items: center;
  gap: 32px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  backdrop-filter: blur(16px);
}

@media (max-width: 520px) {
  .verdict-row {
    flex-direction: column;
    gap: 20px;
    padding: 24px;
  }
}

/* Ring */
.score-ring-container {
  position: relative;
  flex-shrink: 0;
}

.score-ring {
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.3));
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 8;
}

.ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1.2s var(--ease-out), stroke 0.6s;
}

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

.score-num {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #f1f5f9;
  transition: color 0.6s;
}

.score-label {
  font-size: 0.7rem;
  color: #475569;
  font-weight: 600;
}

/* Verdict */
.verdict-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  width: fit-content;
  border: 1px solid;
}

.verdict-desc {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.6;
}

.threat-meter-label {
  font-size: 0.72rem;
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.threat-bar-track {
  height: 6px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.threat-bar-fill {
  height: 100%;
  border-radius: 100px;
  width: 0%;
  background: linear-gradient(90deg, var(--c-safe), var(--c-medium), var(--c-critical));
  transition: width 1.2s var(--ease-out);
}

/* risk level color themes */
.risk-safe .ring-fill {
  stroke: var(--c-safe);
}

.risk-safe .score-num {
  color: var(--c-safe);
}

.risk-safe .verdict-badge {
  color: var(--c-safe);
  background: var(--c-safe-bg);
  border-color: var(--c-safe-border);
}

.risk-low .ring-fill {
  stroke: var(--c-low);
}

.risk-low .score-num {
  color: var(--c-low);
}

.risk-low .verdict-badge {
  color: var(--c-low);
  background: var(--c-low-bg);
  border-color: rgba(34, 211, 238, 0.3);
}

.risk-medium .ring-fill {
  stroke: var(--c-medium);
}

.risk-medium .score-num {
  color: var(--c-medium);
}

.risk-medium .verdict-badge {
  color: var(--c-medium);
  background: var(--c-medium-bg);
  border-color: var(--c-medium-border);
}

.risk-high .ring-fill {
  stroke: var(--c-high);
}

.risk-high .score-num {
  color: var(--c-high);
}

.risk-high .verdict-badge {
  color: var(--c-high);
  background: var(--c-high-bg);
  border-color: var(--c-high-border);
}

.risk-critical .ring-fill {
  stroke: var(--c-critical);
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.6));
}

.risk-critical .score-num {
  color: var(--c-critical);
}

.risk-critical .verdict-badge {
  color: var(--c-critical);
  background: var(--c-critical-bg);
  border-color: var(--c-critical-border);
}

/* findings cards grid */
.findings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.finding-card {
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeSlideUp 0.4s var(--ease-out) both;
  transition: transform 0.2s, box-shadow 0.2s;
}

.finding-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.finding-card.flag-error {
  background: var(--c-critical-bg);
  border-color: var(--c-critical-border);
}

.finding-card.flag-warn {
  background: var(--c-high-bg);
  border-color: var(--c-high-border);
}

.finding-card.flag-caution {
  background: var(--c-medium-bg);
  border-color: var(--c-medium-border);
}

.finding-card.flag-ok {
  background: var(--c-safe-bg);
  border-color: var(--c-safe-border);
}

.finding-icon {
  font-size: 1.3rem;
}

.finding-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e2e8f0;
}

.finding-detail {
  font-size: 0.75rem;
  color: #64748b;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* indicator breakdown table */
.detail-section {
  border-radius: var(--radius-md);
  padding: 22px 24px;
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 16px;
}

.indicator-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.indicator-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  gap: 12px;
}

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

.ind-name {
  font-size: 0.84rem;
  color: #94a3b8;
  flex: 1;
}

.ind-value {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: #e2e8f0;
  max-width: 280px;
  text-align: right;
  word-break: break-all;
}

.ind-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: 12px;
}

.ind-status.ok {
  background: var(--c-safe);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.ind-status.warn {
  background: var(--c-medium);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.ind-status.danger {
  background: var(--c-critical);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* recommendation box */
.recommendation-box {
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.rec-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

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

.rec-body {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.7;
}

.rec-body ul {
  padding-left: 20px;
  margin-top: 8px;
}

.rec-body li {
  margin-bottom: 4px;
}

.rec-safe {
  border-color: var(--c-safe-border);
}

.rec-safe .rec-header {
  color: var(--c-safe);
}

.rec-warn {
  border-color: var(--c-medium-border);
}

.rec-warn .rec-header {
  color: var(--c-medium);
}

.rec-danger {
  border-color: var(--c-critical-border);
}

.rec-danger .rec-header {
  color: var(--c-critical);
}

/* reset/analyze-another button */
.reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
  transition: all 0.2s;
  align-self: center;
}

.reset-btn:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
}

/* stats bar */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: var(--radius-lg);
  margin-top: 48px;
  padding: 20px 0;
}

.stat-item {
  flex: 1;
  text-align: center;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--indigo-light), var(--cyan-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.72rem;
  color: #475569;
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

@media (max-width: 520px) {
  .stats-bar {
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px;
  }

  .stat-divider {
    display: none;
  }

  .stat-item {
    flex: 1 1 40%;
  }
}

/* footer */
.footer {
  text-align: center;
  margin-top: 32px;
  font-size: 0.75rem;
  color: #334155;
  line-height: 1.7;
}

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

/* Animate results in */
.results-panel>* {
  animation: fadeSlideUp 0.5s var(--ease-out) both;
}

.results-panel>*:nth-child(1) {
  animation-delay: 0.05s;
}

.results-panel>*:nth-child(2) {
  animation-delay: 0.12s;
}

.results-panel>*:nth-child(3) {
  animation-delay: 0.19s;
}

.results-panel>*:nth-child(4) {
  animation-delay: 0.26s;
}

.results-panel>*:nth-child(5) {
  animation-delay: 0.33s;
}

.results-panel>*:nth-child(6) {
  animation-delay: 0.40s;
}