/* ============================================
   NOXIDE.TOOLS — MAIN STYLESHEET
   Dark Market / Hacker Terminal Aesthetic
   ============================================ */

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

/* ── CSS VARIABLES ── */
:root {
  --black: #000000;
  --black-light: #0a0a0a;
  --black-lighter: #111111;
  --black-card: #0d0d0d;
  --grey-dark: #1a1a1a;
  --grey-mid: #2a2a2a;
  --grey-light: #3a3a3a;
  --grey-text: #666666;
  --grey-muted: #444444;
  --white: #e0e0e0;
  --white-bright: #ffffff;
  --green: #00ff41;
  --green-dim: #00cc33;
  --green-dark: #003300;
  --green-glow: rgba(0, 255, 65, 0.15);
  --red: #ff0033;
  --red-dim: #cc0029;
  --red-glow: rgba(255, 0, 51, 0.15);
  --amber: #ffaa00;
  --info: #4488ff;
  --info-glow: rgba(68, 136, 255, 0.15);
  --cyan: #00e5ff;
  --cyan-glow: rgba(0, 229, 255, 0.1);
  --font-mono: 'Share Tech Mono', 'Courier New', monospace;
  --font-display: 'Orbitron', sans-serif;
  --font-code: 'JetBrains Mono', monospace;
  --border: 1px solid #1a1a1a;
  --border-green: 1px solid rgba(0, 255, 65, 0.2);
  --border-red: 1px solid rgba(255, 0, 51, 0.2);
  --transition: all 0.2s ease;
  --scanline: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--grey-mid) var(--black);
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-mono);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--grey-mid); }
::-webkit-scrollbar-thumb:hover { background: var(--grey-light); }

::selection {
  background: var(--green);
  color: var(--black);
}

a {
  color: var(--green);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--white-bright);
  text-shadow: 0 0 8px var(--green);
}

img { max-width: 100%; display: block; }

/* ── UTILITY ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.text-center { text-align: center; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-cyan { color: var(--cyan); }
.text-muted { color: var(--grey-text); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.15rem; }
.uppercase { text-transform: uppercase; }
.tracking { letter-spacing: 0.15em; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* ── SCANLINE OVERLAY ── */
.scanlines::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--scanline);
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* ── GLITCH TEXT ── (color displacement removed) */
.glitch {
  position: relative;
  display: inline-block;
}

/* ── NAVBAR ── */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--grey-dark);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--green);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.navbar-brand span {
  color: var(--grey-text);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  margin-left: 8px;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}
.navbar-links a {
  color: var(--grey-text);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: var(--transition);
  position: relative;
}
.navbar-links a:hover,
.navbar-links a.active {
  color: var(--green);
  text-shadow: 0 0 10px var(--green-glow);
}
.navbar-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--green);
  transition: width 0.3s ease;
}
.navbar-links a:hover::after,
.navbar-links a.active::after {
  width: 100%;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--green);
  color: var(--black);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--white-bright);
  box-shadow: 0 0 20px var(--green-glow);
}

.btn-outline {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
}
.btn-outline:hover {
  background: var(--green);
  color: var(--black);
}

.btn-ghost {
  background: transparent;
  color: var(--grey-text);
  border: 1px solid var(--grey-mid);
}
.btn-ghost:hover {
  color: var(--white);
  border-color: var(--grey-light);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(255, 0, 51, 0.3);
}
.btn-danger:hover {
  background: var(--red);
  color: var(--white-bright);
}

.btn-sm { padding: 6px 14px; font-size: 0.7rem; }
.btn-lg { padding: 14px 32px; font-size: 0.9rem; }
.btn-block { width: 100%; }

/* ── CARDS ── */
.card {
  background: var(--black-card);
  border: 1px solid var(--grey-dark);
  padding: 24px;
  transition: var(--transition);
  position: relative;
}
.card:hover {
  border-color: var(--grey-mid);
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card:hover::before {
  opacity: 0.5;
}

/* ── FORM ELEMENTS ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 0.75rem;
  color: var(--grey-text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.form-input {
  background: var(--black);
  border: 1px solid var(--grey-mid);
  color: var(--white);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(0, 255, 65, 0.1);
}
.form-input::placeholder {
  color: var(--grey-muted);
}

.form-select {
  background: var(--black);
  border: 1px solid var(--grey-mid);
  color: var(--white);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}
.badge-green {
  background: var(--green-glow);
  color: var(--green);
  border: 1px solid rgba(0, 255, 65, 0.2);
}
.badge-red {
  background: var(--red-glow);
  color: var(--red);
  border: 1px solid rgba(255, 0, 51, 0.2);
}
.badge-amber {
  background: rgba(255, 170, 0, 0.1);
  color: var(--amber);
  border: 1px solid rgba(255, 170, 0, 0.2);
}
.badge-blue {
  background: var(--info-glow);
  color: var(--info);
  border: 1px solid rgba(68, 136, 255, 0.2);
}
.badge-grey {
  background: rgba(60, 60, 60, 0.3);
  color: var(--grey-text);
  border: 1px solid var(--grey-mid);
}

/* ── TABLES ── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--grey-dark);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead {
  background: var(--black-lighter);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.7rem;
  color: var(--grey-text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  border-bottom: 1px solid var(--grey-dark);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--grey-dark);
  color: var(--white);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ── SIDEBAR LAYOUT ── */
.layout {
  display: flex;
  min-height: 100vh;
  padding-top: 56px;
}

.sidebar {
  width: 240px;
  background: var(--black-light);
  border-right: 1px solid var(--grey-dark);
  padding: 24px 0;
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-section {
  padding: 0 16px;
  margin-bottom: 24px;
}

.sidebar-label {
  font-size: 0.6rem;
  color: var(--grey-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0 12px;
  margin-bottom: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--grey-text);
  font-size: 0.8rem;
  transition: var(--transition);
  border-left: 2px solid transparent;
}
.sidebar-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.03);
  text-shadow: none;
}
.sidebar-link.active {
  color: var(--green);
  border-left-color: var(--green);
  background: var(--green-glow);
}

.sidebar-link svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}
.sidebar-link.active svg,
.sidebar-link:hover svg {
  opacity: 1;
}

.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 32px;
  min-height: calc(100vh - 56px);
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--grey-dark);
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-subtitle {
  font-size: 0.8rem;
  color: var(--grey-text);
  margin-top: 4px;
}

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--black-card);
  border: 1px solid var(--grey-dark);
  padding: 20px;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--grey-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--white-bright);
}

.stat-change {
  font-size: 0.7rem;
  margin-top: 4px;
}
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }

/* ── GRID SYSTEM ── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--black-card);
  border: 1px solid var(--grey-dark);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--grey-dark);
}

/* ── NOTIFICATIONS / TOAST ── */
.toast-container {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--black-card);
  border: 1px solid var(--grey-dark);
  padding: 14px 20px;
  font-size: 0.8rem;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.3s ease;
  border-left: 3px solid var(--green);
}
.toast.error { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--amber); }

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── LOADING / TERMINAL CURSOR ── */
.cursor-blink::after {
  content: '█';
  animation: blink 1s step-end infinite;
  color: var(--green);
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typing-dots::after {
  content: '...';
  animation: typing 1.5s steps(3) infinite;
}
@keyframes typing {
  0% { content: ''; }
  33% { content: '.'; }
  66% { content: '..'; }
  100% { content: '...'; }
}

/* ── PRICE TAG ── */
.price {
  font-family: var(--font-display);
  font-weight: 700;
}
.price-currency {
  font-size: 0.7em;
  color: var(--grey-text);
  vertical-align: top;
}
.price-period {
  font-size: 0.5em;
  color: var(--grey-muted);
  font-weight: 400;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .navbar-links { display: none; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ── PULSE ANIMATION ── */
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(0, 255, 65, 0); }
}

.pulse { animation: pulse-green 2s infinite; }

/* ── FADE IN ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}
.fade-in-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.3s; opacity: 0; }
.fade-in-delay-4 { animation-delay: 0.4s; opacity: 0; }
