/* ==========================================================================
   PortPeek Port Conflict Solver Stylesheet
   Pure Vanilla CSS - Modern High-Tech Developer Tool Aesthetics
   ========================================================================== */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: #131d31;
  --bg-card-hover: #1a2742;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(56, 189, 248, 0.4);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-cyan: #38bdf8;
  --accent-blue: #2563eb;
  --accent-green: #22c55e;
  --accent-purple: #a855f7;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Text', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #7dd3fc;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- NAVBAR --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.nav-logo img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.3));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-badge-pill {
  font-size: 0.75rem;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  margin-left: 4px;
}

.btn-header-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-header-github:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

/* --- HERO SECTION --- */
.conflict-hero {
  padding: 50px 0 30px;
  text-align: center;
  position: relative;
}

.conflict-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 750px;
  height: 380px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.08) 0%, rgba(56, 189, 248, 0.06) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: #f87171;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
}

.hero-title span {
  background: linear-gradient(135deg, #f87171 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

/* --- SOLVER OMNIBOX & SEARCH AREA --- */
.solver-search-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 36px;
  position: relative;
}

.omnibox-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.omnibox-icon {
  position: absolute;
  left: 18px;
  color: var(--accent-cyan);
  pointer-events: none;
}

.omnibox-input {
  width: 100%;
  height: 56px;
  background: rgba(2, 6, 23, 0.8);
  border: 2px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 0 110px 0 54px;
  color: #ffffff;
  font-size: 1.05rem;
  font-family: var(--font-mono);
  transition: all 0.2s ease;
}

.omnibox-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
  background: #020617;
}

.omnibox-btn {
  position: absolute;
  right: 10px;
  height: 38px;
  padding: 0 16px;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.omnibox-btn:hover {
  background: #1d4ed8;
}

/* Sample Quick-Pills */
.sample-pills-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sample-pills-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sample-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sample-pill:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* --- DIAGNOSIS RESULT SECTION --- */
.diagnosis-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 48px;
}

/* Top Diagnostic Status Banner */
.diag-banner {
  background: rgba(19, 29, 49, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  box-shadow: var(--shadow-card);
}

.diag-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.diag-body {
  flex: 1;
}

.diag-status-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.diag-port-badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  padding: 2px 10px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.diag-summary-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Process & PID Specs Bar */
.process-specs-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spec-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.spec-val {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #e2e8f0;
  font-weight: 600;
}

/* --- SIDE-BY-SIDE COMPARISON (MANUAL VS PORTPEEK) --- */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.compare-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.compare-card.manual {
  border-color: rgba(239, 68, 68, 0.25);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.03) 0%, rgba(15, 23, 42, 0.95) 100%);
}

.compare-card.portpeek {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.05) 0%, rgba(15, 23, 42, 0.95) 100%);
  box-shadow: 0 10px 30px -10px rgba(34, 197, 94, 0.15);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-header-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.badge-manual {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.badge-portpeek {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

/* Command Block */
.code-terminal-box {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-bottom: 16px;
  position: relative;
}

.cmd-line {
  color: #cbd5e1;
  margin-bottom: 6px;
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cmd-line .prompt {
  color: #38bdf8;
  margin-right: 6px;
}

.btn-cmd-copy {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 4px;
  color: #94a3b8;
  padding: 3px 8px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-cmd-copy:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* PortPeek Step Cards */
.portpeek-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.step-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-size: 0.85rem;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.step-text strong {
  color: #fff;
}

.btn-demo-kill-action {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  color: #ffffff;
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 0 20px -3px rgba(34, 197, 94, 0.3);
}

.btn-demo-kill-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.5);
}

/* --- SAFE CONFIGURATION WORKAROUNDS --- */
.safe-configs-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 48px;
}

.safe-header {
  margin-bottom: 20px;
}

.safe-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.safe-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.config-snippets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.config-card {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.config-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.config-file-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.config-code-pre {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #38bdf8;
  overflow-x: auto;
  margin-bottom: 8px;
}

/* Security / OAuth Warning Box */
.security-oauth-alert {
  margin-top: 20px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.85rem;
  color: #fcd34d;
}

.security-oauth-alert strong {
  color: #fff;
}

/* --- FOOTER --- */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 30px 0;
  margin-top: 40px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}

.footer-logo img {
  width: 24px;
  height: 24px;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 900px) {
  .hero-title {
    font-size: 2.1rem;
  }
  .compare-grid {
    grid-template-columns: 1fr;
  }
  .config-snippets-grid {
    grid-template-columns: 1fr;
  }
  .process-specs-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}
