/* ============================================================================
   Obfuscator view.

   Deliberately in the dashboard's own visual language (glass panels, blue-violet accent, Segoe UI)
   rather than the Account Manager's, which imitates the desktop app instead. Tokens come from the
   :root block in index.html - this file assumes it is loaded after that page, never standalone.
   ============================================================================ */

.obf-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr);
  gap: 14px;
  /* The settings column is taller than the editor on a wide screen. Stretching keeps the two panes the
     same height instead of leaving a gap under the editor that reads as a rendering bug. */
  align-items: stretch;
  margin-bottom: 14px;
}

/* A short, visible answer to the most common trust question. Deliberately not a modal or a tooltip:
   someone deciding whether to paste their source should see it before they start typing. */
.obf-privacy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid rgba(79, 193, 255, .16);
  border-radius: 9px;
  background: rgba(79, 193, 255, .05);
  color: var(--secondary);
  font-size: 12.5px;
  line-height: 1.5;
}

.obf-privacy strong { color: var(--text); font-weight: 600; }
.obf-privacy-icon { color: var(--accent); font-size: 11px; line-height: 1.65; }

@media (max-width: 900px) {
  .obf-grid { grid-template-columns: 1fr; }
}

.obf-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.obf-grid > .obf-pane { height: 100%; }

/* The editor owns whatever height the row ends up with. */
.obf-pane .obf-code { flex: 1 1 auto; }

.obf-pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--secondary);
}

.obf-meta {
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

.obf-meta.over { color: var(--bad); }

.obf-code {
  width: 100%;
  min-height: 300px;
  max-height: 60vh;
  resize: vertical;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(8, 10, 15, .62);
  color: var(--text);
  font: 12.5px/1.55 'Cascadia Mono', 'Consolas', monospace;
  tab-size: 2;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.obf-code:focus {
  border-color: rgba(79, 193, 255, .55);
  box-shadow: 0 0 0 3px rgba(79, 193, 255, .12);
}

.obf-code[readonly] { color: #C8E9FF; }

.obf-pane-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.obf-hint {
  color: var(--secondary);
  font-size: 12px;
  margin-left: auto;
}

/* ---------- settings ---------- */

.obf-settings { padding: 14px; }

.obf-settings-head {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 10px;
}

.obf-group + .obf-group { margin-top: 14px; }

.obf-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  opacity: .85;
  margin-bottom: 8px;
}

.obf-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
  /* Rows are separated instead of boxed: a card of cards reads as visual noise at this width. */
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.obf-toggle:last-child { border-bottom: 0; }

.obf-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.obf-switch {
  flex: 0 0 auto;
  width: 34px;
  height: 19px;
  margin-top: 1px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  position: relative;
  transition: background .18s, border-color .18s, box-shadow .18s;
}

.obf-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #9AA3AD;
  transition: transform .18s, background .18s;
}

.obf-toggle input:checked + .obf-switch {
  background: linear-gradient(135deg, rgba(79, 193, 255, .55), rgba(139, 124, 255, .5));
  border-color: rgba(79, 193, 255, .7);
  box-shadow: 0 0 14px rgba(79, 193, 255, .35);
}

.obf-toggle input:checked + .obf-switch::after {
  transform: translateX(15px);
  background: #EAF7FF;
}

.obf-toggle input:focus-visible + .obf-switch {
  box-shadow: 0 0 0 3px rgba(79, 193, 255, .25);
}

.obf-toggle-text { display: block; min-width: 0; }

.obf-toggle-text b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.obf-toggle-text small {
  display: block;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--secondary);
  margin-top: 2px;
}

.obf-field { margin-top: 10px; }

.obf-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 5px;
}

.obf-field small {
  display: block;
  color: var(--secondary);
  font-size: 11.5px;
  line-height: 1.45;
  margin-top: 4px;
}

.obf-field select,
.obf-field input[type="text"] {
  width: 100%;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(8, 10, 15, .62);
  color: var(--text);
  padding: 0 10px;
  font: 13px 'Segoe UI', sans-serif;
  outline: none;
}

.obf-field select:focus,
.obf-field input[type="text"]:focus {
  border-color: rgba(79, 193, 255, .55);
  box-shadow: 0 0 0 3px rgba(79, 193, 255, .12);
}

/* ---------- status line ---------- */

.obf-status {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--secondary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.obf-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .75;
  flex: 0 0 auto;
}

.obf-status.ok { color: var(--ok); }
.obf-status.err { color: var(--bad); }
.obf-status.work { color: var(--accent); }

.obf-status.work::before { animation: obf-pulse 1s ease-in-out infinite; }

@keyframes obf-pulse {
  0%, 100% { opacity: .25; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Progress bar: only visible while a build runs, so the page does not imply work when idle. */
.obf-progress {
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, .06);
  opacity: 0;
  transition: opacity .2s;
}

.obf-progress.on { opacity: 1; }

.obf-progress::after {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: obf-slide 1.1s linear infinite;
}

@keyframes obf-slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(350%); }
}
