/* =============================================
   Email Breach Checker — Styles
   ============================================= */

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

:root {
  --bg: #0A0E18;
  --bg-card: #111827;
  --bg-input: #0D1220;
  --bg-hover: #1A2035;
  --border: rgba(99, 102, 241, 0.12);
  --border-focus: rgba(236, 72, 153, 0.5);
  --primary: #EC4899;
  --primary-dim: rgba(236, 72, 153, 0.12);
  --primary-glow: rgba(236, 72, 153, 0.25);
  --accent: #8B5CF6;
  --accent-dim: rgba(139, 92, 246, 0.12);
  --green: #10B981;
  --green-dim: rgba(16, 185, 129, 0.12);
  --red: #EF4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --yellow: #F59E0B;
  --yellow-dim: rgba(245, 158, 11, 0.12);
  --text: #F1F5F9;
  --text-dim: #94A3B8;
  --text-muted: #475569;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, sans-serif;
  --transition: 0.25s ease;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }
body::before { content: ''; position: fixed; inset: 0; background: radial-gradient(ellipse at top, rgba(236,72,153,0.04), transparent 50%), radial-gradient(ellipse at bottom, rgba(139,92,246,0.03), transparent 50%); pointer-events: none; }

/* Header */
.header { border-bottom: 1px solid var(--border); background: rgba(17,24,39,0.9); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 800px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.3rem; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--primary-dim); border-radius: var(--radius-sm); }
.logo h1 { font-size: 1.1rem; font-weight: 700; }
.tagline { font-size: 0.72rem; color: var(--text-dim); }
.header-actions { display: flex; gap: 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-family: var(--font); font-size: 0.82rem; font-weight: 500; border: none; border-radius: 6px; cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; font-weight: 600; }
.btn-primary:hover { box-shadow: 0 4px 16px var(--primary-glow); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--primary); background: var(--primary-dim); }
.btn-sm { padding: 6px 10px; font-size: 0.78rem; }

/* Main */
.main { max-width: 800px; margin: 0 auto; padding: 0 20px 60px; }

/* Hero */
.hero { padding: 48px 0 32px; text-align: center; }
.hero-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { font-size: 1rem; color: var(--text-dim); margin-top: 6px; margin-bottom: 28px; }

.search-form { max-width: 560px; margin: 0 auto; }
.search-input-wrap { display: flex; align-items: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; transition: all var(--transition); }
.search-input-wrap:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--primary-dim); }

.search-icon { flex-shrink: 0; margin: 0 10px; color: var(--text-muted); }

.search-input { flex: 1; padding: 12px 8px; font-family: var(--font); font-size: 1rem; color: var(--text); background: transparent; border: none; outline: none; }
.search-input::placeholder { color: var(--text-muted); }

.search-btn { padding: 10px 24px; border-radius: var(--radius-sm); }

.hero-note { font-size: 0.72rem; color: var(--text-muted); margin-top: 12px; }

/* Spinner */
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; }
.spinner[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Section Title */
.section-title { font-size: 1rem; font-weight: 600; color: var(--text-dim); margin-bottom: 14px; }

/* Results Card */
.results-section { margin-top: 24px; }

.results-card { padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); text-align: center; animation: fadeSlide 0.4s ease; }
.results-card.safe { background: var(--green-dim); border-color: rgba(16,185,129,0.3); }
.results-card.warning { background: var(--yellow-dim); border-color: rgba(245,158,11,0.3); }
.results-card.danger { background: var(--red-dim); border-color: rgba(239,68,68,0.3); }

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

.result-icon { font-size: 3rem; margin-bottom: 8px; }
.result-title { font-size: 1.3rem; font-weight: 700; }
.result-subtitle { font-size: 0.88rem; color: var(--text-dim); margin-top: 4px; }
.result-count { font-size: 2.5rem; font-weight: 800; margin-top: 12px; }
.result-count.green { color: var(--green); }
.result-count.red { color: var(--red); }
.result-count.yellow { color: var(--yellow); }

/* Breach List */
.breach-list-section { margin-top: 24px; }
.breach-list { display: flex; flex-direction: column; gap: 8px; }

.breach-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); animation: fadeSlide 0.4s ease; }
.breach-item:hover { border-color: rgba(236,72,153,0.2); }

.breach-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); font-size: 1.3rem; flex-shrink: 0; }
.breach-icon.high { background: var(--red-dim); }
.breach-icon.medium { background: var(--yellow-dim); }
.breach-icon.low { background: var(--green-dim); }

.breach-info { flex: 1; }
.breach-name { font-weight: 600; font-size: 0.92rem; }
.breach-date { font-size: 0.75rem; color: var(--text-dim); }
.breach-data { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.breach-severity { padding: 3px 10px; font-size: 0.7rem; font-weight: 600; border-radius: 4px; text-transform: uppercase; }
.breach-severity.high { background: var(--red-dim); color: var(--red); }
.breach-severity.medium { background: var(--yellow-dim); color: var(--yellow); }
.breach-severity.low { background: var(--green-dim); color: var(--green); }

/* Recommendations */
.recs-section { margin-top: 24px; }
.recs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

.rec-card { padding: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: all var(--transition); }
.rec-card:hover { border-color: rgba(139,92,246,0.3); transform: translateY(-2px); }
.rec-icon { font-size: 1.5rem; margin-bottom: 6px; }
.rec-title { font-weight: 600; font-size: 0.88rem; margin-bottom: 4px; }
.rec-text { font-size: 0.78rem; color: var(--text-dim); line-height: 1.5; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-overlay[hidden] { display: none; }
.modal { width: 100%; max-width: 500px; max-height: 80vh; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1rem; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 1.4rem; cursor: pointer; }
.modal-body { padding: 16px; overflow-y: auto; }

.history-item { display: flex; align-items: center; justify-content: space-between; padding: 10px; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.history-item:last-child { border-bottom: none; }
.history-email { color: var(--text); font-weight: 500; }
.history-result { font-size: 0.72rem; font-weight: 600; }
.history-result.safe { color: var(--green); }
.history-result.breached { color: var(--red); }
.history-date { font-size: 0.7rem; color: var(--text-muted); }

.empty-state { text-align: center; padding: 24px; color: var(--text-muted); font-size: 0.85rem; }

/* Responsive */
@media (max-width: 600px) {
  .hero-title { font-size: 1.5rem; }
  .search-input-wrap { flex-direction: column; }
  .search-btn { width: 100%; justify-content: center; margin-top: 4px; }
  .search-icon { display: none; }
  .recs-grid { grid-template-columns: 1fr; }
}
