/* ═══════════════════════════════════════════════
   ObfuscatorJS — Global CSS Design System
   ═══════════════════════════════════════════════ */

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

/* ── CSS Variables ───────────────────────────── */
:root {
  --bg: #060810;
  --bg2: #0c1020;
  --surface: #101628;
  --surface2: #161e36;
  --border: rgba(99, 120, 255, 0.15);
  --border-bright: rgba(99, 120, 255, 0.4);
  --primary: #6378ff;
  --primary-light: #8b9fff;
  --accent: #a855f7;
  --accent2: #22d3ee;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --text: #e8eaf6;
  --text-muted: #7b85b0;
  --text-dim: #4a5280;
  --font: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 40px rgba(99,120,255,0.12);
  --glow: 0 0 20px rgba(99,120,255,0.35);
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; outline: none; font-family: var(--font); }
textarea, input { font-family: var(--mono); outline: none; border: none; }

/* ── Background Effects ──────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(99,120,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,120,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.orb {
  position: fixed; border-radius: 50%; filter: blur(100px);
  pointer-events: none; z-index: 0; animation: drift 20s ease-in-out infinite alternate;
}
.orb1 { width:600px; height:600px; top:-200px; left:-200px; background:rgba(99,120,255,0.08); animation-delay:0s; }
.orb2 { width:500px; height:500px; bottom:-150px; right:-150px; background:rgba(168,85,247,0.07); animation-delay:-7s; }
.orb3 { width:400px; height:400px; top:50%; left:50%; transform:translate(-50%,-50%); background:rgba(34,211,238,0.04); animation-delay:-14s; }
@keyframes drift { 0%{transform:translate(0,0);} 100%{transform:translate(40px,30px);} }
.orb3 { animation: drift3 18s ease-in-out infinite alternate; }
@keyframes drift3 { 0%{transform:translate(-50%,-50%);} 100%{transform:translate(-43%,-55%);} }

/* ── Navbar ──────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 64px;
  background: rgba(6,8,16,0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.4rem; color: var(--primary); filter: drop-shadow(0 0 6px var(--primary)); }
.logo-text { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.3px; }
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* Subtle admin micro button */
.admin-micro-btn {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.12);
  background: transparent;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}
.admin-micro-btn:hover { color: rgba(255,255,255,0.35); }

/* ── Hero ────────────────────────────────────── */
.hero {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  min-height: 100vh;
  padding: 100px 24px 60px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(99,120,255,0.1);
  border: 1px solid rgba(99,120,255,0.25);
  color: var(--primary-light);
  font-size: 0.8rem; font-weight: 600;
  padding: 6px 16px; border-radius: 100px;
  margin-bottom: 28px;
  animation: fadeDown 0.6s ease both;
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800; line-height: 1.1;
  letter-spacing: -2px;
  animation: fadeDown 0.7s ease both 0.1s;
  margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(135deg, #6378ff 0%, #a855f7 50%, #22d3ee 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  max-width: 580px; font-size: 1.05rem; color: var(--text-muted); font-weight: 400;
  animation: fadeDown 0.7s ease both 0.2s; margin-bottom: 40px;
}
.cta-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 1rem; font-weight: 600;
  padding: 14px 32px; border-radius: 50px;
  animation: fadeDown 0.7s ease both 0.3s;
  box-shadow: 0 0 30px rgba(99,120,255,0.4), 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 0 50px rgba(99,120,255,0.6), 0 8px 30px rgba(0,0,0,0.4); }
.cta-arrow { transition: transform 0.2s; }
.cta-btn:hover .cta-arrow { transform: translateX(4px); }
.hero-stats {
  display: flex; align-items: center; gap: 24px;
  margin-top: 56px;
  animation: fadeDown 0.7s ease both 0.4s;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

@keyframes fadeDown { from{opacity:0;transform:translateY(-16px);} to{opacity:1;transform:none;} }

/* ── Obfuscator Section ──────────────────────── */
.obfuscator-section {
  position: relative; z-index: 1;
  padding: 40px 24px 80px;
}
.tool-container {
  max-width: 1300px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--shadow), var(--shadow-glow);
}
.tool-header { margin-bottom: 24px; }
.tool-title-row { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; }
.tool-title { font-size: 1.5rem; font-weight: 700; }
.badge { font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 100px; }
.badge-green { background: rgba(34,197,94,0.12); color: var(--green); border: 1px solid rgba(34,197,94,0.25); }
.tool-desc { color: var(--text-muted); font-size: 0.9rem; font-family: var(--font); }

/* Identifier row */
.identifier-row { margin-bottom: 20px; }
.input-group-small label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; display: block; }
.input-group-small input {
  width: 300px; max-width: 100%;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); font-size: 0.85rem; font-family: var(--font);
  padding: 8px 14px; border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}
.input-group-small input:focus { border-color: var(--border-bright); }

/* Editors grid */
.editors-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px; align-items: start;
}
.editor-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.editor-panel:focus-within { border-color: var(--border-bright); box-shadow: var(--glow); }

.editor-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.editor-dots { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #22c55e; }
.editor-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); flex: 1; }
.editor-actions { display: flex; gap: 6px; }
.icon-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 3px 8px; border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.code-editor {
  width: 100%; height: 380px;
  background: var(--bg2);
  color: var(--accent2);
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.7;
  padding: 16px;
  resize: vertical;
  border: none;
}
.code-editor::placeholder { color: var(--text-dim); }
.output-editor { color: #a3e635; }

.editor-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
}
.char-count { font-size: 0.72rem; color: var(--text-dim); }
.compression-info { font-size: 0.72rem; color: var(--accent); }

/* Center controls */
.center-controls {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding-top: 50px;
  gap: 12px;
}
.obfuscate-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 0.85rem; font-weight: 700;
  padding: 20px 22px; border-radius: 14px;
  box-shadow: 0 0 30px rgba(99,120,255,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 100px;
}
.obfuscate-btn:hover { transform: scale(1.04); box-shadow: 0 0 50px rgba(99,120,255,0.6); }
.obfuscate-btn:active { transform: scale(0.97); }
.btn-icon { font-size: 1.4rem; }
.btn-text { font-size: 0.75rem; letter-spacing: 0.5px; }
.btn-loader { animation: spin 0.8s linear infinite; font-size: 1.2rem; }
.btn-loader.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Status bar */
.status-bar {
  margin-top: 16px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.status-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); }
.status-dot.success { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.error { background: var(--red); box-shadow: 0 0 6px var(--red); }
.status-dot.loading { background: var(--primary); box-shadow: 0 0 6px var(--primary); animation: pulse 1s ease infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

/* Toast */
.toast {
  position: fixed; bottom: 32px; right: 32px; z-index: 9999;
  background: var(--surface2);
  border: 1px solid var(--border-bright);
  color: var(--text); font-size: 0.85rem; font-weight: 500;
  padding: 12px 22px; border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; pointer-events: auto; transform: none; }

/* ── Features Section ────────────────────────── */
.features-section {
  position: relative; z-index: 1;
  padding: 80px 24px;
  text-align: center;
}
.section-title { font-size: clamp(1.8rem,4vw,2.8rem); font-weight: 800; letter-spacing: -1px; margin-bottom: 10px; }
.section-sub { color: var(--text-muted); margin-bottom: 48px; font-size: 1rem; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px; max-width: 1100px; margin: 0 auto;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(99,120,255,0.12);
}
.feature-icon { font-size: 1.8rem; margin-bottom: 14px; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* ── How To Section ──────────────────────────── */
.howto-section {
  position: relative; z-index: 1; padding: 60px 24px 80px;
  text-align: center;
}
.steps-row {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap; margin-top: 40px; max-width: 900px; margin-inline: auto;
}
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px;
  flex: 1; min-width: 200px; max-width: 280px;
  text-align: center;
  transition: border-color 0.2s;
}
.step-card:hover { border-color: var(--border-bright); }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 1.2rem; font-weight: 800;
  margin-bottom: 16px; box-shadow: 0 0 20px rgba(99,120,255,0.4);
}
.step-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.step-card p { font-size: 0.85rem; color: var(--text-muted); }
.step-arrow { font-size: 1.5rem; color: var(--border-bright); }

/* ── Footer ──────────────────────────────────── */
.footer {
  position: relative; z-index: 1;
  padding: 32px 24px; text-align: center;
  border-top: 1px solid var(--border);
}
.footer-logo { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; }
.footer-copy { font-size: 0.8rem; color: var(--text-dim); }

/* ── Admin Pages ─────────────────────────────── */
.admin-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 44px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow), var(--shadow-glow);
}
.admin-card-header { text-align: center; margin-bottom: 32px; }
.admin-logo { font-size: 2rem; margin-bottom: 10px; }
.admin-card-header h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.admin-card-header p { font-size: 0.85rem; color: var(--text-muted); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.form-group input {
  width: 100%; background: var(--bg2);
  border: 1px solid var(--border); color: var(--text);
  font-family: var(--font); font-size: 0.9rem;
  padding: 12px 16px; border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--border-bright); box-shadow: 0 0 0 3px rgba(99,120,255,0.1); }
.submit-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 0.95rem; font-weight: 700;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 8px;
}
.submit-btn:hover { opacity: 0.9; }
.submit-btn:active { transform: scale(0.98); }
.error-msg { color: var(--red); font-size: 0.8rem; margin-top: 12px; text-align: center; display: none; }
.back-link { display: block; text-align: center; margin-top: 20px; font-size: 0.82rem; color: var(--text-muted); }
.back-link:hover { color: var(--text); }

/* Admin Panel */
.admin-panel-page {
  position: relative; z-index: 1;
  min-height: 100vh; padding: 80px 24px 40px;
}
.panel-container { max-width: 1200px; margin: 0 auto; }
.panel-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px; flex-wrap: wrap; gap: 16px;
}
.panel-title { font-size: 1.8rem; font-weight: 800; }
.panel-title span { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); margin-left: 10px; }
.logout-btn {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.25);
  color: var(--red); font-size: 0.82rem; font-weight: 600;
  padding: 7px 18px; border-radius: 8px;
  transition: background 0.2s;
}
.logout-btn:hover { background: rgba(239,68,68,0.2); }

.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.stat-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.stat-tile .label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-tile .value { font-size: 2rem; font-weight: 800; }

.codes-table-wrapper {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 12px;
}
.table-header h3 { font-size: 1rem; font-weight: 700; }
.search-input {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 0.85rem;
  padding: 7px 14px; border-radius: 8px; width: 220px;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--border-bright); outline: none; }

.codes-table { width: 100%; border-collapse: collapse; }
.codes-table th {
  background: var(--bg2); font-size: 0.72rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  padding: 12px 18px; text-align: left; border-bottom: 1px solid var(--border);
}
.codes-table td {
  padding: 14px 18px; font-size: 0.82rem;
  border-bottom: 1px solid rgba(99,120,255,0.07);
  vertical-align: top;
}
.codes-table tr:last-child td { border-bottom: none; }
.codes-table tr:hover td { background: rgba(99,120,255,0.04); }
.code-preview {
  font-family: var(--mono); font-size: 0.75rem; color: var(--accent2);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px; max-height: 80px; overflow: hidden;
  position: relative; white-space: pre-wrap; word-break: break-all;
  cursor: pointer;
}
.code-preview::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 30px; background: linear-gradient(transparent, var(--bg2));
}
.code-preview.expanded { max-height: none; }
.code-preview.expanded::after { display: none; }
.expand-btn {
  background: none; color: var(--primary); font-size: 0.72rem;
  padding: 2px 0; margin-top: 4px; font-family: var(--font);
}
.expand-btn:hover { text-decoration: underline; }
.delete-btn {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--red); font-size: 0.72rem;
  padding: 4px 10px; border-radius: 6px;
  transition: background 0.15s;
}
.delete-btn:hover { background: rgba(239,68,68,0.2); }
.ip-badge {
  background: rgba(99,120,255,0.1); color: var(--primary-light);
  font-size: 0.7rem; padding: 2px 8px; border-radius: 4px;
  font-family: var(--mono);
}
.ts-text { color: var(--text-muted); font-size: 0.78rem; }
.empty-state {
  text-align: center; padding: 64px;
  color: var(--text-muted); font-size: 0.9rem;
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.loading-spinner {
  display: flex; align-items: center; justify-content: center;
  padding: 64px; color: var(--text-muted);
  gap: 12px; font-size: 0.9rem;
}
.spinner-icon { animation: spin 1s linear infinite; font-size: 1.2rem; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 900px) {
  .editors-grid { grid-template-columns: 1fr; }
  .center-controls { flex-direction: row; padding: 0; justify-content: center; }
  .obfuscate-btn { flex-direction: row; padding: 14px 24px; width: auto; min-width: auto; }
  .navbar { padding: 0 20px; }
  .hero-stats { gap: 16px; }
}
@media (max-width: 600px) {
  .tool-container { padding: 20px; }
  .admin-card { padding: 28px 22px; }
  .step-arrow { display: none; }
  .steps-row { flex-direction: column; }
}
