/* =====================================================================
   SecureCheck — style.css
   A clean, dark-themed, fully responsive stylesheet.
   No external dependencies. Flexbox/Grid layout only.
   ===================================================================== */

/* ── Google Fonts ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Custom Properties ────────────────────────────────────────── */
:root {
  /* Colors */
  --bg-primary:       #0d0f14;
  --bg-secondary:     #141720;
  --bg-card:          #1a1d27;
  --bg-card-hover:    #1f2231;
  --bg-input:         #0f1118;
  --border:           #2a2d3d;
  --border-focus:     #5b6af8;

  /* Text */
  --text-primary:     #eef0f8;
  --text-secondary:   #8b8fa8;
  --text-muted:       #565a72;
  --text-code:        #a5b4fc;

  /* Brand */
  --accent:           #5b6af8;
  --accent-hover:     #4a58e8;
  --accent-glow:      rgba(91, 106, 248, 0.2);

  /* Verdict colors */
  --low-bg:           rgba(16, 185, 129, 0.12);
  --low-border:       #10b981;
  --low-text:         #34d399;
  --medium-bg:        rgba(245, 158, 11, 0.12);
  --medium-border:    #f59e0b;
  --medium-text:      #fbbf24;
  --high-bg:          rgba(239, 68, 68, 0.12);
  --high-border:      #ef4444;
  --high-text:        #f87171;

  /* Safe/Breached */
  --safe-bg:          rgba(16, 185, 129, 0.12);
  --safe-border:      #10b981;
  --safe-text:        #34d399;
  --breach-bg:        rgba(239, 68, 68, 0.12);
  --breach-border:    #ef4444;
  --breach-text:      #f87171;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

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

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card:   0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-input:  0 0 0 3px var(--accent-glow);
  --shadow-btn:    0 4px 14px rgba(91, 106, 248, 0.3);
}

/* ── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s ease;
}
a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--text-code);
  background: rgba(165, 180, 252, 0.08);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

ul { list-style: none; }

/* ── Screen reader only ───────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Subtle grid background ───────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(91, 106, 248, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 106, 248, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── Site Header ──────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, #141824 0%, #0d0f14 100%);
  border-bottom: 1px solid var(--border);
  padding: var(--space-xl) var(--space-md);
  position: relative;
  z-index: 1;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 12px rgba(91, 106, 248, 0.6));
}

.logo-text {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #eef0f8 30%, #5b6af8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 400;
}

/* ── Main Content ─────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  position: relative;
  z-index: 1;
}

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  transition: border-color 0.2s ease;
}
.card:hover {
  border-color: rgba(91, 106, 248, 0.3);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.section-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  margin-top: 2px;
  filter: drop-shadow(0 0 8px rgba(91, 106, 248, 0.4));
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Input Group ──────────────────────────────────────────────────── */
.input-group {
  display: flex;
  gap: var(--space-sm);
  align-items: stretch;
}

.text-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: var(--space-sm) var(--space-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
.text-input::placeholder {
  color: var(--text-muted);
  font-family: var(--font-sans);
}
.text-input:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-input);
}

.pw-input-wrapper {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}
.pw-input-wrapper .text-input {
  width: 100%;
  padding-right: 44px;
}

.pw-eye-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}
.pw-eye-btn:hover { color: var(--text-secondary); }

.input-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: calc(var(--space-xs) * -1);
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  padding: var(--space-sm) var(--space-lg);
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(91, 106, 248, 0.45);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 6px var(--space-md);
}

.btn-icon {
  font-size: 1rem;
}

/* ── Result Area ──────────────────────────────────────────────────── */
.result-area {
  border-radius: var(--radius-md);
  padding: var(--space-md);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  animation: fadeSlideIn 0.25s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.verdict-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ── Verdict Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid;
}

.badge.low {
  background: var(--low-bg);
  border-color: var(--low-border);
  color: var(--low-text);
}
.badge.medium {
  background: var(--medium-bg);
  border-color: var(--medium-border);
  color: var(--medium-text);
}
.badge.high {
  background: var(--high-bg);
  border-color: var(--high-border);
  color: var(--high-text);
}
.badge.safe {
  background: var(--safe-bg);
  border-color: var(--safe-border);
  color: var(--safe-text);
}
.badge.breached {
  background: var(--breach-bg);
  border-color: var(--breach-border);
  color: var(--breach-text);
}

.score-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Reasons List ─────────────────────────────────────────────────── */
.reasons-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-xs) 0 0;
}
.reasons-list li {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  font-size: 0.83rem;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.reasons-list li:last-child { border-bottom: none; }
.reasons-list li::before {
  content: '›';
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.no-issues {
  font-size: 0.83rem;
  color: var(--low-text);
  font-style: italic;
}

/* ── Password specific ────────────────────────────────────────────── */
.pw-message {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
}

.hash-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.hash-label { flex-shrink: 0; }
.hash-code {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

/* ── Loader ───────────────────────────────────────────────────────── */
.loader-area {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Collapsible Test Cases ───────────────────────────────────────── */
.test-cases-section {
  border-top: 1px solid var(--border);
  padding-top: var(--space-md);
}

.collapsible-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 0;
  transition: color 0.15s ease;
}
.collapsible-toggle:hover { color: var(--text-primary); }
.collapsible-toggle .chevron {
  transition: transform 0.2s ease;
}
.collapsible-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.collapsible-body {
  padding-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.test-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.test-case-row {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
}

.test-url {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  word-break: break-all;
  overflow-wrap: anywhere;
}

.test-expected {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.test-status {
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.test-status.pass { color: var(--low-text); }
.test-status.fail { color: var(--high-text); }
.test-status.pending { color: var(--text-muted); }

/* ── Footer ───────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.8;
  position: relative;
  z-index: 1;
}
.footer-links { margin-top: 4px; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .card { padding: var(--space-lg) var(--space-md); }
  .main-content { padding: var(--space-lg) var(--space-sm) var(--space-2xl); }

  .input-group { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .pw-input-wrapper { width: 100%; }

  .card-header { gap: var(--space-sm); }
  .section-icon { font-size: 1.4rem; }
  .section-title { font-size: 1.1rem; }

  .test-case-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .test-expected { order: 3; }
  .test-status { order: 2; }

  .logo-text { font-size: 1.4rem; }
}

@media (max-width: 375px) {
  .logo-text { font-size: 1.25rem; }
  .section-title { font-size: 1rem; }
  .text-input { font-size: 0.8rem; }
}
