/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --bg: #1B4965; /* black colour #0F1419 */
  --surface: #161D27;
  --surface-2: #BFEFFF;/*--surface-2: #1D2733;*/
  --border: #2A3644;
  --text: #E5E9F0;
  --text-muted:#C2185B;/*--text-muted: #7C8798;*/

  --oui: #F0B429;        /* amber - vendor prefix */
  --nic: #5EEAD4;        /* teal  - device identifier */
  --danger: #F87171;     /* soft red - errors */
  --success: #5EEAD4;

  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
}

body.light {
  --bg: #1B4965;/*--bg: #F3F5F7; */
  --surface: #FFFFFF;
  --surface-2: #F0F2F5;
  --border: #DDE3EA;
  --text: #16202B;
  --text-muted: #5B6572;
  --shadow: 0 20px 50px -25px rgba(20,30,40,0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  transition: background .25s ease, color .25s ease;
  min-height: 100%;
}

#grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 64px 20px 48px;
}

.header {
  text-align: center;
  margin-bottom: 32px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nic);
  margin-bottom: 14px;
}

h1 {
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0;
}

/* ==========================================================================
   Card
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.input-row {
  display: flex;
  gap: 8px;
}

#mac-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 0.05em;
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

#mac-input::placeholder { color: var(--text-muted); opacity: 0.6; }

#mac-input:focus {
  border-color: var(--nic);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.15);
}

.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  width: 48px;
  cursor: pointer;
  font-size: 16px;
  transition: color .2s ease, border-color .2s ease, transform .1s ease;
}
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }
.icon-btn:active { transform: scale(0.94); }

/* ==========================================================================
   Byte visualizer -- signature element
   ========================================================================== */
.byte-visualizer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 22px 0 8px;
  flex-wrap: wrap;
}

.byte-group {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 10px;
  transition: background .3s ease, box-shadow .3s ease;
}

.byte {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all .2s ease;
}

.byte-group.oui .byte.active { color: var(--oui); border-color: var(--oui); background: rgba(240, 180, 41, 0.12); }
.byte-group.nic .byte.active { color: var(--nic); border-color: var(--nic); background: rgba(94, 234, 212, 0.12); }

.byte-group.found {
  box-shadow: 0 0 0 1px var(--oui);
  animation: scan-flash 0.5s ease;
}

@keyframes scan-flash {
  0% { background: rgba(240, 180, 41, 0.25); }
  100% { background: transparent; }
}

.byte-caption {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 22px;
  font-family: var(--font-mono);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.oui-dot { background: var(--oui); }
.nic-dot { background: var(--nic); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.search-btn {
  width: 100%;
  padding: 15px;
  background: var(--nic);
  color: #0F1419;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform .1s ease, opacity .2s ease, box-shadow .2s ease;
}
.search-btn:hover { box-shadow: 0 8px 24px -8px rgba(94, 234, 212, 0.5); }
.search-btn:active { transform: scale(0.98); }
.search-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.copy-btn {
  margin-top: 18px;
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: all .2s ease;
}
.copy-btn:hover { border-color: var(--nic); color: var(--nic); }
.copy-btn.copied { border-color: var(--success); color: var(--success); }

.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { color: var(--danger); }

/* ==========================================================================
   Error + result
   ========================================================================== */
.error-msg {
  margin-top: 16px;
  text-align: center;
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 14px;
}

.hidden { display: none !important; }

.result-card {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--border);
  animation: fade-up .3s ease;
}

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

.result-status {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: 0.03em;
}
.result-status.ok { color: var(--nic); }
.result-status.not-found { color: var(--danger); }

.result-source {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  margin: -8px 0 16px;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-key {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.result-val {
  font-size: 16px;
  font-weight: 500;
}

.result-val.mono { font-family: var(--font-mono); letter-spacing: 0.03em; }

/* ==========================================================================
   History
   ========================================================================== */
.history-section { margin-top: 32px; }

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history-header h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-empty {
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-mono);
  padding: 12px 0;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color .2s ease, transform .1s ease;
}
.history-item:hover { border-color: var(--nic); }
.history-item:active { transform: scale(0.99); }

.history-mac {
  font-family: var(--font-mono);
  font-size: 13px;
}

.history-vendor {
  font-size: 12px;
  color: var(--text-muted);
}

.history-vendor.not-found { color: var(--danger); }

/* ==========================================================================
   Misc
   ========================================================================== */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  transition: transform .2s ease, border-color .2s ease;
}
.theme-toggle:hover { border-color: var(--nic); transform: rotate(20deg); }

.footer {
  margin-top: 40px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.footer code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 480px) {
  .card { padding: 22px; }
  .byte { width: 30px; height: 30px; font-size: 12px; }
  .result-grid { grid-template-columns: 1fr; }
}
