/* =============================================
   LogMasq — Dark Theme CSS
   ============================================= */

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

:root {
  --bg:         #0d0d0f;
  --bg-2:       #111114;
  --bg-3:       #18181d;
  --bg-card:    #141418;
  --border:     #232329;
  --border-2:   #2e2e38;
  --text:       #e8e8f0;
  --text-muted: #6b6b80;
  --text-dim:   #3e3e50;
  --accent:     #00e5ff;
  --accent-dim: rgba(0, 229, 255, 0.12);
  --accent-glow:rgba(0, 229, 255, 0.25);
  --violet:     #7c3aed;
  --violet-dim: rgba(124, 58, 237, 0.12);
  --red:        #ff4d6d;
  --red-dim:    rgba(255, 77, 109, 0.15);
  --green:      #00d68f;
  --green-dim:  rgba(0, 214, 143, 0.12);
  --radius:     12px;
  --radius-sm:  7px;
  --font-mono:  'Space Mono', 'Courier New', monospace;
  --font-sans:  'DM Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Noise & Grid overlays ---- */
.noise-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.6;
}

.grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* =============================================
   LANDING PAGE
   ============================================= */
.landing {
  position: relative; z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 24px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

/* ---- Logo ---- */
.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: fadeUp 0.6s ease both;
}

.logo-graphic {
  position: relative;
  width: 100px; height: 100px;
  filter: drop-shadow(0 0 24px rgba(0,229,255,0.3));
}

.logo-svg { width: 100%; height: 100%; }

.logo-text {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}

.logo-name {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo-name-sm {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.accent { color: var(--accent); }

.logo-tagline {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}



/* ---- Upload ---- */
.upload-zone {
  animation: fadeUp 0.6s 0.2s ease both;
}

.btn-upload {
  display: inline-block;
  padding: 10px 28px;
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.btn-upload:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 20px var(--accent-glow);
}

.upload-formats {
  font-size: 0.73rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-align: center;
}



/* ---- Upload Progress ---- */
.upload-progress {
  padding: 48px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* ---- Features ---- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  width: 100%;
  animation: fadeUp 0.6s 0.3s ease both;
}

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex; flex-direction: column; gap: 8px;
}

.feature-icon { font-size: 1.4rem; }
.feature strong { font-weight: 600; font-size: 0.9rem; }
.feature p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }

/* =============================================
   RESULTS PAGE
   ============================================= */
.results-page {
  position: relative; z-index: 1;
  min-height: 100vh;
}

.results-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(13,13,15,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
}

.results-meta {
  display: flex; align-items: center; gap: 16px;
}

.filename-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-3);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-ghost {
  background: none; border: 1px solid var(--border-2);
  color: var(--text-muted); border-radius: var(--radius-sm);
  padding: 6px 14px; font-size: 0.82rem; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.results-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 120px;
  display: flex; flex-direction: column; gap: 40px;
}

/* ---- Summary ---- */
.results-summary {
  display: flex; flex-wrap: wrap; gap: 16px;
  animation: fadeUp 0.4s ease both;
}

.stat-card {
  flex: 1 1 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 4px;
}

.stat-card .btn-randomize-all {
  margin-top: 12px;
  align-self: flex-start;
}

.stat-card .stat-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---- Findings Section ---- */
.findings-section {
  animation: fadeUp 0.4s ease both;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.01em;
}

.btn-randomize-all {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-randomize-all:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.badge-ip {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(0,229,255,0.25);
}

.badge-domain {
  background: var(--violet-dim);
  color: #a78bfa;
  border: 1px solid rgba(124,58,237,0.3);
}

/* ---- Table ---- */
.findings-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.88rem;
}

.findings-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.findings-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.findings-table tbody tr:last-child { border-bottom: none; }
.findings-table tbody tr:hover { background: var(--bg-3); }

.findings-table td {
  padding: 10px 16px;
  vertical-align: middle;
}

.original-value {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
}

.replacement-field {
  display: flex; align-items: center; gap: 8px;
}

.replacement-input {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.replacement-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.replacement-input::placeholder { color: var(--text-dim); }

.btn-randomize {
  flex-shrink: 0;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn-randomize:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.btn-randomize svg { flex-shrink: 0; }

/* ---- Anonymize Footer ---- */
.anonymize-footer {
  position: sticky;
  bottom: 0;
  background: rgba(13,13,15,0.95);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  margin: 0 -24px -120px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.btn-anonymize {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--accent), #00b8d4);
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: opacity 0.2s, box-shadow 0.2s, transform 0.1s;
  box-shadow: 0 0 28px var(--accent-glow);
}

.btn-anonymize:hover {
  opacity: 0.9;
  box-shadow: 0 0 40px rgba(0,229,255,0.4);
}

.btn-anonymize:active { transform: scale(0.98); }

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

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

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .landing { padding: 40px 16px 60px; }
  .results-header { padding: 12px 16px; }
  .results-content { padding: 24px 16px 100px; }
  .anonymize-footer { flex-direction: column; align-items: stretch; }
  .btn-anonymize { justify-content: center; }
  .findings-table thead th:last-child { display: none; }
}
