/* ============================================================
   Mario's Cyber Form — styles.css
   Theme: Dark terminal / cybersecurity SaaS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables — LIGHT is default ── */
:root {
  --bg:          #eef4fb;
  --surface:     #ffffff;
  --surface2:    #f0f6fc;
  --border:      #ccdaeb;
  --accent:      #0077cc;
  --accent2:     #7b5ea7;
  --accent3:     #00a05a;
  --text:        #142032;
  --text-muted:  #5e7d96;
  --danger:      #e03050;
  --warn:        #c07000;
  --font-mono:   'Share Tech Mono', monospace;
  --font-body:   'DM Sans', sans-serif;
  --radius:      10px;
  --radius-lg:   18px;
  --shadow:      0 4px 32px rgba(0,100,160,0.10);
  --transition:  0.22s cubic-bezier(0.4,0,0.2,1);
  --spark-glow:  rgba(0,100,220,0.85);
}

[data-theme="dark"] {
  --bg:          #080d14;
  --surface:     #0d1520;
  --surface2:    #111d2e;
  --border:      #1e3148;
  --accent:      #00d4ff;
  --accent3:     #00ff88;
  --text:        #c9dde8;
  --text-muted:  #5a7a8e;
  --danger:      #ff4d6a;
  --warn:        #ffb340;
  --shadow:      0 4px 32px rgba(0,212,255,0.06);
  --spark-glow:  rgba(0,220,255,0.9);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Background grid (spark canvas sits on top via JS) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,100,200,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,100,200,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}
[data-theme="dark"] body::before {
  background-image:
    linear-gradient(rgba(0,212,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.04) 1px, transparent 1px);
}

/* Spark canvas layer (injected by ui.js) */
#sparkCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition);
}
[data-theme="dark"] .navbar {
  background: rgba(8,13,20,0.88);
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 17px;
  color: var(--accent);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.nav-brand span { color: var(--accent3); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 13px;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: rgba(0,212,255,0.08);
  text-decoration: none;
}

.nav-right { display: flex; align-items: center; gap: 10px; }

/* Dark mode toggle */
.theme-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
}
.theme-toggle:hover { background: var(--border); transform: rotate(20deg); }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 720px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 62px; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 16px;
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 10px 14px; }
}

/* ── Page wrapper ── */
.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Hero section (index) ── */
.hero {
  text-align: center;
  padding: 64px 0 48px;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #0a2040 30%, #0077cc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="dark"] .hero h1 {
  background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero p {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

/* ── Tool cards grid (index) ── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 10px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 40px rgba(0,212,255,0.12);
  text-decoration: none;
  color: var(--text);
}
.tool-card-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 4px;
}
.tool-card-title {
  font-size: 17px;
  font-weight: 600;
}
.tool-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.tool-card-arrow {
  margin-top: auto;
  font-size: 13px;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ── Card / panel ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-header h2 {
  font-size: 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-header p {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Page title ── */
.page-title {
  margin-bottom: 32px;
}
.page-title .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.page-title h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
}
.page-title p {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-muted);
}

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 7px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.12);
}
textarea { resize: vertical; min-height: 100px; font-family: var(--font-mono); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  color: #030c14;
}
.btn-primary:hover { box-shadow: 0 4px 20px rgba(0,212,255,0.35); }

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

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-ghost:hover { background: rgba(0,212,255,0.08); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}

/* ── Strength meter ── */
.strength-meter {
  height: 6px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.strength-bar {
  height: 100%;
  width: 0;
  border-radius: 4px;
  transition: width 0.35s ease, background 0.35s ease;
}

.strength-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Checkbox group ── */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.checkbox-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  user-select: none;
}
.checkbox-pill:has(input:checked) {
  border-color: var(--accent);
  background: rgba(0,212,255,0.07);
  color: var(--accent);
}
.checkbox-pill input { accent-color: var(--accent); cursor: pointer; }

/* ── Row layout ── */
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.row-spaced { justify-content: space-between; }

/* ── Advice list ── */
.advice-list {
  list-style: none;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.advice-list li {
  font-size: 13px;
  color: var(--warn);
  padding: 6px 10px;
  background: rgba(255,179,64,0.07);
  border-left: 3px solid var(--warn);
  border-radius: 0 6px 6px 0;
  font-family: var(--font-mono);
}

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent3);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: toastIn 0.28s ease;
  max-width: 300px;
}
.toast.error { border-left-color: var(--danger); }
.toast.warn  { border-left-color: var(--warn); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ── Learning Hub ── */
.learning-section + .learning-section { margin-top: 28px; }
.learning-section h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.learning-section p, .learning-section li {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-muted);
}
.learning-section ul {
  list-style: none;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.learning-section ul li::before {
  content: '▸ ';
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ── About page ── */
.about-intro {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.contact-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color var(--transition);
}
.contact-card:hover { border-color: var(--accent); }
.contact-icon { font-size: 22px; }
.contact-info a { font-size: 14px; color: var(--accent); }
.contact-info span { display: block; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px; }

/* ── Skills badges ── */
.skills-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.badge {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.2);
  color: var(--accent);
}

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}
.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent); text-decoration: none; }
.footer-copy {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Fade-in animation ── */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  animation: fadeIn 0.5s ease forwards;
}
@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-1 { animation-delay: 0.05s; }
.fade-in-2 { animation-delay: 0.12s; }
.fade-in-3 { animation-delay: 0.20s; }
.fade-in-4 { animation-delay: 0.28s; }
.fade-in-5 { animation-delay: 0.36s; }

/* ── Misc helpers ── */
.mono { font-family: var(--font-mono); }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.mt-8  { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mt-20 { margin-top: 20px; }
hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ── Number input ── */
input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

/* ── Show/hide toggle icon ── */
.input-wrapper {
  position: relative;
}
.input-wrapper input { padding-right: 44px; }
.input-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  padding: 2px;
  transition: color var(--transition);
}
.input-toggle:hover { color: var(--accent); }

/* ── Select dropdowns ── */
select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 14px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235e7d96' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,119,204,0.12);
}
[data-theme="dark"] select:focus {
  box-shadow: 0 0 0 3px rgba(0,212,255,0.12);
}

/* ── Output / result box ── */
.output-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 60px;
}
.output-box .out-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}
.output-box .out-value {
  color: var(--accent);
  font-weight: 600;
}

/* ── Two-column form row ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }

/* ── IP result table ── */
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 4px;
}
.result-table tr { border-bottom: 1px solid var(--border); }
.result-table tr:last-child { border-bottom: none; }
.result-table td {
  padding: 9px 6px;
  vertical-align: top;
}
.result-table td:first-child {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  width: 44%;
  font-family: var(--font-mono);
}
.result-table td:last-child {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
  word-break: break-all;
}

/* ── Section divider ── */
.section-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* ── Advice list — green good state ── */
.advice-good {
  font-size: 13px;
  color: var(--accent3);
  padding: 6px 10px;
  background: rgba(0,160,90,0.07);
  border-left: 3px solid var(--accent3);
  border-radius: 0 6px 6px 0;
  font-family: var(--font-mono);
}
[data-theme="dark"] .advice-good {
  background: rgba(0,255,136,0.07);
}
