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

:root {
  --bg:          #04080f;
  --bg2:         #070d1c;
  --bg3:         #0a1228;
  --bg4:         #0d1830;
  --blue:        #3b82f6;
  --blue-bright: #60a5fa;
  --blue-dim:    #1d4ed8;
  --cyan:        #22d3ee;
  --cyan-soft:   #67e8f9;
  --purple:      #818cf8;
  --green:       #22c55e;
  --glow:        rgba(59,130,246,0.14);
  --glow-strong: rgba(59,130,246,0.28);
  --text:        #e2e8f0;
  --text-dim:    #94a3b8;
  --muted:       #3d5070;
  --border:      rgba(59,130,246,0.12);
  --border-h:    rgba(96,165,250,0.38);
  --border-glow: rgba(96,165,250,0.58);
  --sidebar-w:   230px;
  --radius:      14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grid texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
  z-index: 0;
}

/* Radial ambient top */
body::after {
  content: '';
  position: fixed;
  top: -280px; left: 50%;
  transform: translateX(-50%);
  width: 1100px; height: 650px;
  background: radial-gradient(ellipse, rgba(59,130,246,0.07) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* ── MODAL — must be highest z-index ── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2,4,10,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999;  /* above sidebar (z:100) */
  justify-content: center;
  align-items: center;
}

.modal-content {
  width: 480px;
  max-width: 92vw;
  background: linear-gradient(145deg, #080f1e 0%, #0c1728 100%);
  color: var(--text);
  padding: 36px 36px 28px;
  border-radius: 20px;
  border: 1px solid var(--border-h);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.06) inset,
    0 40px 90px rgba(0,0,0,0.75),
    0 0 70px rgba(59,130,246,0.1);
  position: relative;
  animation: modalIn 0.28s cubic-bezier(0.34,1.56,0.64,1) both;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-bright), transparent);
  opacity: 0.5;
  border-radius: 50%;
}

/* close X */
.modal-close {
  position: absolute;
  top: 16px; right: 20px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59,130,246,0.08);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-family: 'Space Mono', monospace;
  transition: all 0.2s;
  line-height: 1;
}
.modal-close:hover { color: var(--text); border-color: var(--border-h); background: rgba(59,130,246,0.15); }

@keyframes modalIn {
  from { opacity:0; transform: scale(0.88) translateY(20px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}

.modal-content h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(130deg, #fff 0%, var(--blue-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 22px;
  padding-right: 32px;
}

.modal-section {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--cyan);
  text-transform: uppercase;
  margin: 18px 0 8px;
  opacity: 0.7;
}

.modal-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal-content ul li {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-dim);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.modal-content ul li::before {
  content: '›';
  position: absolute; left: 0;
  color: var(--blue-bright);
  font-weight: 700;
}

.modal-content code {
  background: rgba(59,130,246,0.10);
  padding: 1px 7px;
  border-radius: 4px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--cyan-soft);
  border: 1px solid var(--border);
}

.modal-content button {
  width: 100%;
  margin-top: 22px;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-dim) 0%, var(--blue) 100%);
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.22s;
  box-shadow: 0 4px 24px rgba(59,130,246,0.35);
}

.modal-content button:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-bright) 100%);
  box-shadow: 0 6px 32px rgba(59,130,246,0.55);
  transform: translateY(-1px);
}

.modal-content button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100%;
  background: linear-gradient(180deg, rgba(7,13,28,0.98) 0%, rgba(4,8,15,0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;  /* below modal (9999) */
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), var(--cyan), transparent);
  opacity: 0.55;
}

.sidebar-logo {
  text-align: center;
  padding: 28px 20px 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.sidebar-logo img {
  width: 54px;
  filter: drop-shadow(0 0 18px rgba(59,130,246,0.75)) drop-shadow(0 0 40px rgba(96,165,250,0.25));
  transition: filter 0.3s;
}
.sidebar-logo:hover img { filter: drop-shadow(0 0 26px rgba(96,165,250,0.95)) drop-shadow(0 0 52px rgba(34,211,238,0.35)); }

.sidebar-title {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--cyan-soft);
  letter-spacing: 0.2em;
  margin-top: 10px;
  opacity: 0.7;
}

.nav-section-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.2em;
  padding: 16px 20px 6px;
  text-transform: uppercase;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  margin: 2px 10px;
  border-radius: 10px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  text-decoration: none;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  position: relative;
}

.nav-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  background: linear-gradient(180deg, var(--blue), var(--cyan));
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-btn:hover { background: rgba(59,130,246,0.08); color: var(--text); transform: translateX(3px); }
.nav-btn.active { background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(34,211,238,0.05)); color: var(--blue-bright); border-color: var(--border-h); }
.nav-btn.active::before { opacity: 1; }

.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.status-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--muted);
}

.status-dot::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  flex-shrink: 0;
  animation: pulseGreen 2.5s ease-in-out infinite;
}

@keyframes pulseGreen {
  0%,100% { opacity:1; box-shadow: 0 0 8px var(--green); }
  50%      { opacity:0.55; box-shadow: 0 0 18px var(--green); }
}

/* ── CONTENT ── */
.content {
  margin-left: var(--sidebar-w);
  padding: 44px 48px 72px;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 1020px;
}

/* ── PAGES ── */
.page { display: none; }
.page.active { display: block; animation: fadeUp 0.32s ease both; }

/* ── PAGE HEADER ── */
.page-header {
  margin-bottom: 36px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 72px; height: 1px;
  background: linear-gradient(90deg, var(--blue), transparent);
}

.page-tag {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: 0.18em;
  margin-bottom: 10px;
  opacity: 0.65;
}

.page-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  background: linear-gradient(130deg, #fff 0%, var(--blue-bright) 55%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── CARD ── */
.card {
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 12px 0;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, rgba(59,130,246,0.07) 0%, rgba(34,211,238,0.03) 60%, transparent 100%);
  opacity: 0;
  transition: opacity 0.28s;
}

.card::after {
  content: '';
  position: absolute;
  left: 0; top: 18%; bottom: 18%;
  width: 2px;
  background: linear-gradient(180deg, var(--blue), var(--cyan));
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.28s;
}

.card:hover { border-color: var(--border-h); transform: translateY(-3px) translateX(2px); box-shadow: 0 12px 40px rgba(59,130,246,0.16), 0 0 0 1px rgba(96,165,250,0.06) inset; }
.card:hover::before { opacity: 1; }
.card:hover::after  { opacity: 1; }

.card-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--blue-bright);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.card:hover .card-title { color: var(--cyan-soft); }

.card-sub {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

.card-badge {
  position: absolute;
  top: 18px; right: 20px;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(59,130,246,0.10);
  color: var(--blue-bright);
  border: 1px solid var(--border);
  letter-spacing: 0.10em;
}

/* ── PROGRAMS GRID CARDS ── */
.prog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.prog-card {
  background: linear-gradient(145deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.prog-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  opacity: 0;
  transition: opacity 0.28s;
}

.prog-card:hover { border-color: var(--border-h); transform: translateY(-4px); box-shadow: 0 16px 48px rgba(59,130,246,0.18); }
.prog-card:hover::before { opacity: 1; }

.prog-card.disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

.prog-icon {
  font-size: 26px;
  line-height: 1;
}

.prog-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--blue-bright);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.prog-card:hover .prog-name { color: var(--cyan-soft); }

.prog-desc {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
  flex: 1;
}

.prog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.prog-tag {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(59,130,246,0.08);
  color: var(--text-dim);
  border: 1px solid var(--border);
  letter-spacing: 0.08em;
}

.prog-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--blue-bright);
  opacity: 0.75;
  transition: opacity 0.2s;
}
.prog-card:hover .prog-action { opacity: 1; }

/* ── BUTTON ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 10px;
  border: 1px solid var(--border-h);
  background: rgba(59,130,246,0.10);
  color: var(--blue-bright);
  text-decoration: none;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s;
}
.btn:hover { background: rgba(59,130,246,0.2); border-color: var(--border-glow); box-shadow: 0 0 20px rgba(59,130,246,0.25); transform: translateY(-2px); }

/* ── CODE BOX ── */
.code-box-wrap { position: relative; }

.code-box-header {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 11px 18px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.code-box-header .dot { width: 10px; height: 10px; border-radius: 50%; }
.code-box-header .dot.red    { background: #ef4444; }
.code-box-header .dot.yellow { background: #f59e0b; }
.code-box-header .dot.green  { background: #22c55e; }
.code-box-header .lang {
  margin-left: auto;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.code-box {
  background: #020408;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 26px 28px;
  white-space: pre-wrap;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: #7dd3fc;
  max-height: 480px;
  overflow: auto;
  line-height: 1.8;
  box-shadow: inset 0 2px 24px rgba(0,0,0,0.6);
}
.code-box::-webkit-scrollbar { width: 5px; }
.code-box::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 3px; }

/* ── COPY BTN ── */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 30px;
  background: linear-gradient(135deg, var(--blue-dim), var(--blue));
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: all 0.22s;
  margin: 18px 0;
  box-shadow: 0 4px 22px rgba(59,130,246,0.32);
}
.copy-btn:hover { background: linear-gradient(135deg, var(--blue), var(--blue-bright)); box-shadow: 0 6px 30px rgba(59,130,246,0.52); transform: translateY(-2px); }

/* ── BACK LINK ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan-soft);
  text-decoration: none;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  margin-bottom: 32px;
  opacity: 0.6;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s;
}
.back-link:hover { opacity: 1; border-color: var(--border); background: rgba(103,232,249,0.05); transform: translateX(-2px); }

/* ── SEARCH ── */
.search-box {
  width: 100%;
  padding: 13px 18px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  margin-bottom: 22px;
  transition: all 0.2s;
}
.search-box:focus { border-color: var(--border-h); box-shadow: 0 0 0 3px rgba(59,130,246,0.07); }
.search-box::placeholder { color: var(--muted); }

/* ── GENERATOR ── */
#output {
  text-align: center;
  font-size: 34px;
  letter-spacing: 12px;
  font-family: 'Space Mono', monospace;
  color: var(--blue-bright);
  margin: 28px 0;
  text-shadow: 0 0 24px rgba(59,130,246,0.5);
  min-height: 52px;
}

.legendary {
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--purple), var(--blue));
  background-size: 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 2s linear infinite;
}

@keyframes shimmer { to { background-position: 300%; } }

.history {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 16px 20px;
  margin-top: 14px;
  max-height: 170px;
  overflow: auto;
  font-size: 12px;
  font-family: 'Space Mono', monospace;
  color: var(--muted);
  line-height: 2;
}
.history::-webkit-scrollbar { width: 4px; }
.history::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── SCRIPT META / INFO ── */
.script-meta { font-family: 'Space Mono', monospace; font-size: 11px; color: var(--muted); margin-top: 8px; }

.info-strip { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }

.info-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  min-width: 90px;
}
.info-pill .label { font-family: 'Space Mono', monospace; font-size: 9px; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; }
.info-pill .value { font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700; color: var(--blue-bright); }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  :root { --sidebar-w: 200px; }
  .content { padding: 26px 20px 60px; }
  .prog-grid { grid-template-columns: 1fr; }
}
