/* DataPhantom — Sleek minimal cyberpunk theme, responsive */

:root {
  --bg: #0a0a0c;
  --bg-card: #0f0f12;
  --surface: #141418;
  --border: rgba(0, 255, 255, 0.15);
  --cyan: #00ffff;
  --cyan-dim: #00b8b8;
  --cyan-glow: rgba(0, 255, 255, 0.25);
  --text: #e0e0e0;
  --text-dim: #888;
  --font: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --radius: 4px;
  --space: 1.5rem;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-y: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar {
  display: none;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space);
}

/* Header / Nav */
.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem var(--space);
  border-bottom: 1px solid var(--border);
}

/* Fixed (sticky) header on main landing page */
body.landing .site-header-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg, #0a0a0a);
}
body.landing main {
  padding-top: 5rem;
}

.site-header .header-left {
  position: absolute;
  left: 25%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.site-header .header-right {
  position: absolute;
  left: 75%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.site-header .nav-links {
  position: absolute;
  right: var(--space);
  top: 50%;
  transform: translateY(-50%);
}

/* Logo: same font as extension (Courier New / Consolas / Monaco) */
.logo {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  width: min-content;
  font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 22px;
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan-glow);
  line-height: 1;
  font-family: inherit;
}

.logo-text {
  font-family: inherit;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 4px;
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan-glow);
  transition: animation 0s;
}

.logo-text .accent {
  color: var(--cyan-dim);
}

/* Glitch only when pointer is directly over the logo (icon or text), not the whole row */
.logo .logo-icon:hover ~ .logo-text,
.logo .logo-text:hover {
  animation: logo-glitch 0.3s ease;
}

@keyframes logo-glitch {
  0%   { transform: translate(0); }
  20%  { transform: translate(-2px, 1px); }
  40%  { transform: translate(2px, -1px); }
  60%  { transform: translate(-1px, -1px); }
  80%  { transform: translate(1px, 1px); }
  100% { transform: translate(0); }
}

/* Status strip under logo (same as extension) */
.header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.status-strip {
  margin-top: 8px;
}

.status-label {
  display: block;
  font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
  font-size: 9px;
  color: var(--cyan);
  text-shadow: 0 0 6px var(--cyan-glow);
  letter-spacing: 2px;
  min-height: 14px;
  text-align: center;
}

.status-label .blink {
  animation: blink-cursor 1s steps(1) infinite;
  color: var(--cyan);
}

@keyframes blink-cursor {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .site-header .nav-links {
    position: static;
    transform: none;
    margin-top: 0.5rem;
  }
  .site-header:not(.site-header-fixed) {
    flex-wrap: wrap;
    justify-content: center;
  }
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--cyan); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--cyan);
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  border-radius: var(--radius);
}

.btn:hover {
  background: rgba(0, 255, 255, 0.08);
  box-shadow: 0 0 20px var(--cyan-glow);
}

.btn-primary {
  background: var(--cyan);
  color: var(--bg);
  border-color: var(--cyan);
}

.btn-primary:hover {
  background: var(--cyan-dim);
  border-color: var(--cyan-dim);
  color: var(--bg);
  box-shadow: 0 0 24px var(--cyan-glow);
}

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

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

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

/* Hero / Landing */
.hero {
  padding: 4rem var(--space) 5rem;
  text-align: center;
}

.hero-tag {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1rem;
  opacity: 0.9;
  white-space: nowrap;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #fff;
}

.hero p,
.hero .hero-desc {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.hero .hero-desc {
  margin-bottom: 0.5rem;
}
.hero .hero-desc:last-of-type {
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space);
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space);
}

.login-box {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-box h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.login-box p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.login-box .btn {
  width: 100%;
  padding: 0.9rem;
}

.login-intro { margin-bottom: 1rem; }
.login-divider {
  margin: 1.5rem 0 1rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.login-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  margin-bottom: 0.75rem;
}
.login-form input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan-glow);
}
.login-form button { margin-top: 0.25rem; }
.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 1rem 0 0;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.terms-checkbox input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--cyan);
}
.terms-checkbox a {
  color: var(--cyan);
  text-decoration: none;
}
.terms-checkbox a:hover { text-decoration: underline; }
.btn-block { width: 100%; }
.login-toggle {
  margin-top: 1rem;
  margin-bottom: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--cyan);
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover { color: var(--cyan-dim); }
.link-cyan { color: var(--cyan); text-decoration: none; }
.link-cyan:hover { text-decoration: underline; color: var(--cyan-dim); }
.login-error {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #ff6b6b;
}
.login-code {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--cyan);
  margin: 1rem 0;
  word-break: break-all;
}
.login-hint { font-size: 0.8rem; margin-bottom: 1rem; }
.hidden { display: none !important; }

/* Admin */
.admin-page {
  min-height: 100vh;
  padding: var(--space);
}

.admin-gate {
  max-width: 400px;
  margin: 4rem auto;
}

.admin-gate h1 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #fff;
}

.admin-gate label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.admin-gate input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  margin-bottom: 1rem;
}

.admin-gate input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan-glow);
}

.admin-dashboard { display: none; }
.admin-dashboard.visible { display: block; }

.admin-bar,
.account-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.account-bar {
  justify-content: center;
}

.account-bar a.active,
.account-bar .btn.active {
  color: var(--cyan);
  border-color: var(--cyan);
}

.admin-bar {
  justify-content: center;
}

.admin-bar h1 { font-size: 1.25rem; color: #fff; }

.admin-tab.active { color: var(--cyan); border-color: var(--cyan); }

.admin-section-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.admin-search-wrap {
  flex: 0 1 auto;
  min-width: 180px;
  max-width: 320px;
}
.admin-search-wrap .input-sm {
  width: 100%;
}

.admin-msg {
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

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

.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(0, 255, 255, 0.03); }

.admin-set-plan-wrap { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.admin-set-plan-label { font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; }
.admin-set-plan-select { min-width: 7rem; }

.admin-self-role { font-size: 0.85rem; }
.admin-self-label { color: var(--text-dim); font-size: 0.8rem; font-weight: normal; }
.admin-self-actions { color: var(--text-dim); }

.admin-audit-toolbar { flex-wrap: wrap; }
.admin-date-label { font-size: 0.85rem; color: var(--text-dim); display: inline-flex; align-items: center; gap: 0.35rem; }
.admin-date-input { min-width: 10rem; }

/* Admin stats page */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.admin-stat-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.admin-stat-card .admin-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--cyan); }
.admin-stat-card .admin-stat-label { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.05em; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 2px;
  background: var(--surface);
  color: var(--text-dim);
}

.badge.trial { color: var(--cyan); border: 1px solid var(--cyan); }
.badge.trial_ended { color: #ff9900; border: 1px solid #ff9900; }
.badge.monthly { color: var(--green); border: 1px solid var(--green); }
.badge.yearly { color: #00ccff; border: 1px solid #00ccff; }
.badge.cancelled { color: #ffcc00; border: 1px solid #ffcc00; }
.badge.expired { color: #ff6666; border: 1px solid #ff6666; }

/* Admin confirm modal (suspend / delete) */
.admin-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.admin-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}
.admin-confirm-dialog {
  position: relative;
  max-width: 400px;
  width: 100%;
  padding: 1.5rem;
}
.admin-confirm-title { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text); }
.admin-confirm-desc { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 0.75rem; }
.admin-confirm-hint { font-size: 0.8rem; color: var(--cyan); margin-bottom: 1rem; }
.admin-confirm-form label { display: block; font-size: 0.8rem; color: var(--text-dim); margin-top: 0.75rem; margin-bottom: 0.25rem; }
.admin-confirm-form label:first-of-type { margin-top: 0; }
.admin-confirm-form input { width: 100%; margin-bottom: 0.25rem; }
.admin-confirm-error { font-size: 0.85rem; color: #ff6666; margin-top: 0.5rem; }
.admin-confirm-actions { margin-top: 1.25rem; display: flex; gap: 0.75rem; justify-content: flex-end; }

/* Overview (home) */
.overview {
  padding: 2rem var(--space) 3rem;
  max-width: 640px;
  margin: 0 auto;
}
.overview h2 {
  font-size: 1rem;
  color: var(--cyan);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.overview p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.65;
}

/* Features (home) */
.features {
  padding: 0 var(--space) 3rem;
  max-width: 640px;
  margin: 0 auto;
}
.features h2 {
  font-size: 1rem;
  color: var(--cyan);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.65;
}
.features-list li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.6rem;
}
.features-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--cyan);
}

/* Footer */
.site-footer {
  padding: 2rem var(--space);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.footer-logo {
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: center;
}
.footer-logo .logo { color: var(--text); }
.footer-logo-img {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
}
.footer-overview {
  margin-bottom: 1rem;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1rem;
}
.footer-legal { margin-top: 0.5rem; }
.footer-sep { margin: 0 0.35rem; color: var(--text-dim); opacity: 0.7; }
.site-footer a { color: var(--cyan); text-decoration: none; }
.footer-legal a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
  .hero { padding: 3rem var(--space) 4rem; }
  .site-header { padding: 0.75rem var(--space); }
  .nav-links { gap: 1rem; }
  .admin-table th,
  .admin-table td { padding: 0.5rem 0.75rem; font-size: 0.8rem; }

  /* Landing header: switch from absolute to flex so Download / Logo / Sign in don't overlap */
  body.landing .site-header-fixed {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  body.landing .site-header-fixed .header-left,
  body.landing .site-header-fixed .header-right {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    flex-shrink: 0;
  }
  body.landing .site-header-fixed .header-brand {
    flex-shrink: 0;
    margin: 0 0.5rem;
  }
  /* Match footer logo size on mobile */
  body.landing .site-header-fixed .logo-text {
    font-size: 20px;
    letter-spacing: 4px;
  }
  body.landing .site-header-fixed .logo-icon {
    font-size: 22px;
  }
  body.landing .site-header-fixed .status-label {
    font-size: 8px;
  }
  /* Hero tag: allow wrap on small screens to avoid horizontal scroll */
  .hero-tag {
    white-space: normal;
    letter-spacing: 0.12em;
  }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .container { padding: 1rem; }
  .hero { padding: 2rem 1rem 3rem; }
  .hero h1 { font-size: 1.75rem; }
  .hero-tag { font-size: 0.7rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  /* Tighter header on very small screens; allow wrap so logo can sit above buttons */
  body.landing .site-header-fixed {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  body.landing .site-header-fixed .header-brand {
    order: -1;
    flex-basis: 100%;
    margin: 0;
  }
  body.landing .site-header-fixed .header-left,
  body.landing .site-header-fixed .header-right {
    display: flex;
    flex: 1;
    justify-content: center;
  }
  body.landing .site-header-fixed .header-left { justify-content: flex-end; }
  body.landing .site-header-fixed .header-right { justify-content: flex-start; }
  body.landing .site-header-fixed .header-left .btn,
  body.landing .site-header-fixed .header-right .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  /* Keep header logo same size as footer on small mobile */
  body.landing .site-header-fixed .logo-text {
    font-size: 20px;
    letter-spacing: 4px;
  }
  body.landing .site-header-fixed .logo-icon {
    font-size: 22px;
  }
  body.landing main { padding-top: 6rem; }
  .overview,
  .features { padding-left: 1rem; padding-right: 1rem; }
  .site-footer { padding: 1.5rem 1rem; }
}
