/* Henderson Cisco Configuration Generator – high-tech theme
   Deep blue/black, glowing cyan accents, orange CTAs, circuit/network feel */

:root {
  /* Core theme from reference image */
  --bg-deep: #050810;
  --bg-dark: #0a0f1a;
  --bg-card: rgba(12, 20, 36, 0.85);
  --bg-input: rgba(8, 18, 32, 0.9);
  --border-subtle: rgba(0, 212, 255, 0.15);
  --border-accent: rgba(0, 212, 255, 0.4);
  --accent-cyan: #00d4ff;
  --accent-cyan-dim: #00a8cc;
  --accent-blue: #38bdf8;
  --accent-orange: #f97316;
  --accent-orange-glow: rgba(249, 115, 22, 0.4);
  --text-primary: #f0f9ff;
  --text-secondary: #94c5e0;
  --text-muted: #5b8fb8;
  --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.25);
  --glow-orange: 0 0 24px rgba(249, 115, 22, 0.35);
  --font-heading: 'Orbitron', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

/* Full-page theme background: deep space blue + subtle grid */
.theme-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(0, 100, 150, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 80% 60% at 80% 100%, rgba(249, 115, 22, 0.06) 0%, transparent 45%),
    linear-gradient(180deg, var(--bg-deep) 0%, #0a1220 40%, var(--bg-dark) 100%);
}

/* Subtle circuit-style grid overlay */
.theme-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 0%, transparent 75%);
}

/* Soft glow orbs (lens-flare style) */
.theme-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
}
.theme-glow--topleft {
  width: 400px;
  height: 400px;
  top: -150px;
  left: -150px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.2) 0%, transparent 70%);
}
.theme-glow--topright {
  width: 300px;
  height: 300px;
  top: -80px;
  right: -80px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.12) 0%, transparent 70%);
}
.theme-glow--bottom {
  width: 350px;
  height: 350px;
  bottom: -120px;
  left: 30%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
}

.app {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ----- Header ----- */
.header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), transparent);
  box-shadow: var(--glow-cyan);
}

.header h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  text-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
}

@media (min-width: 560px) {
  .header h1 {
    font-size: 1.75rem;
  }
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* ----- Main layout ----- */
.main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ----- Cards: glassy panels with cyan edge ----- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.08), var(--glow-cyan);
}

.card h2 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
  text-transform: uppercase;
}

/* Collapsible sections */
.card.collapsible .collapse-trigger {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0;
}

.card.collapsible .collapse-trigger:hover {
  color: var(--accent-blue);
}

.collapse-icon {
  font-size: 0.65rem;
  color: var(--accent-cyan);
  transition: transform 0.2s;
}

.collapse-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
}

.collapse-panel.open {
  max-height: 1200px;
  transition: max-height 0.35s ease-in;
}

.card.collapsible .collapse-panel.open {
  margin-top: 1rem;
  padding-top: 0;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ----- Form fields ----- */
.field {
  margin-bottom: 1rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field textarea {
  min-height: 4rem;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
}

.vlan-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 560px) {
  .vlan-row {
    grid-template-columns: 1fr;
  }
}

.error-msg {
  font-size: 0.85rem;
  color: #f87171;
  margin-top: 0.75rem;
}

.hidden {
  display: none !important;
}

/* ----- Actions ----- */
.actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.7rem 1.35rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  letter-spacing: 0.02em;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-orange) 0%, #ea580c 100%);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-orange-glow);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: var(--glow-orange);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-accent);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(0, 212, 255, 0.08);
  color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

/* ----- Output block ----- */
.output-wrap {
  margin-top: 0.5rem;
}

.output-wrap h2 {
  margin-bottom: 0.75rem;
}

.output {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 400px;
  overflow-y: auto;
}

.output::-webkit-scrollbar {
  width: 8px;
}
.output::-webkit-scrollbar-track {
  background: var(--bg-deep);
  border-radius: 4px;
}
.output::-webkit-scrollbar-thumb {
  background: var(--border-accent);
  border-radius: 4px;
}

.copy-feedback {
  font-size: 0.85rem;
  color: #34d399;
  margin-left: 0.5rem;
}

.btn-tertiary {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-accent);
}

.btn-tertiary:hover:not(:disabled) {
  background: rgba(0, 212, 255, 0.08);
  color: var(--accent-cyan);
}


/* ---------------------------------------------------------------------------
   Beginner-facing additions: the read-before-you-paste notice, the template
   buttons, the inline hints, and the plain-English summary.
   ------------------------------------------------------------------------ */

.notice {
  border-left: 4px solid var(--accent-orange, #E8590C);
  font-size: 0.95rem;
  line-height: 1.55;
}

.presets .preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0.8;
}

.field--check label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.field--check input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.summary-list {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.6;
}

.summary-list li { margin-bottom: 0.35rem; }

/* Warnings have to survive being skimmed. */
.summary-list li.summary-warn {
  color: var(--accent-orange, #E8590C);
  font-weight: 600;
}


/* ---------------------------------------------------------------------------
   Config syntax highlighting.

   The warning about plain-text passwords used to be the same grey as every
   other line, which is a good way to make sure nobody reads it. Colour here is
   doing a job, not decorating.
   ------------------------------------------------------------------------ */

.tok-comment { opacity: 0.45; }
.tok-cmd     { color: #4FC3F7; font-weight: 600; }
.tok-ip      { color: #FFB74D; }
.tok-intf    { color: #81C784; }
.tok-num     { color: #FFD54F; }

.tok-warn {
  color: #FF7043;
  font-weight: 700;
}

/* ---------------------------------------------------------------------------
   The "now check it worked" list.
   ------------------------------------------------------------------------ */

.verify-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.verify-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.verify-list li:last-child { border-bottom: 0; }

.verify-list code {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.92rem;
  color: #4FC3F7;
  margin-bottom: 0.15rem;
  overflow-wrap: anywhere;
}

.verify-why {
  font-size: 0.85rem;
  opacity: 0.75;
  line-height: 1.45;
}

/* Everyone forgets to save, once, and only once. */
.verify-list li.verify-save code { color: #FF7043; }
.verify-list li.verify-save .verify-why { opacity: 1; font-weight: 600; }

/* ===========================================================================
   SCI-FI OVERLAY
   ===========================================================================

   Appended last so it wins on specificity without editing the rules above.

   The flat square grid read as graph paper. What replaces it: a horizon grid
   that recedes and drifts, a slow scanline wash, HUD corner brackets on every
   card, and a scan sweep across the output panel. The palette does not change
   -- the cyan and orange were already right -- it is put to work instead.

   One rule the whole thing obeys: this is a tool people read Cisco commands
   in. Every effect sits BEHIND or AROUND the content, never over the text, and
   the whole lot switches off under prefers-reduced-motion. A config you cannot
   read is not a nicer config.
   ========================================================================= */

:root {
  --scan-speed: 8s;
  --grid-speed: 22s;
  /* The syntax colours are pulled onto the theme's own accents so the output
     panel belongs to the page instead of looking like a pasted-in snippet. */
  --tok-cmd: var(--accent-cyan);
  --tok-ip: #ffb861;
  --tok-intf: #7df9c4;
  --tok-num: #ffd479;
  --tok-warn: var(--accent-orange);
}

/* --- the horizon ---------------------------------------------------------
   Two grids: one lying flat and receding to a vanishing point, one standing
   up behind it. The floor drifts toward the viewer, which is what sells the
   depth; the wall stays still so the eye has something fixed. */

.theme-grid {
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, transparent 42%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, transparent 42%);
}

.theme-bg::after {
  content: "";
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -10%;
  height: 70vh;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.16) 1px, transparent 1px);
  background-size: 80px 80px;
  transform: perspective(340px) rotateX(72deg);
  transform-origin: 50% 100%;
  animation: grid-drift var(--grid-speed) linear infinite;
  mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, transparent 72%);
  -webkit-mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, transparent 72%);
  pointer-events: none;
}

@keyframes grid-drift {
  from { background-position: 0 0; }
  to   { background-position: 0 80px; }
}

/* --- scanlines + a slow wash --------------------------------------------
   Fixed to the viewport rather than the page so it feels like the screen you
   are looking at, not a texture on the document. */

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.16) 0px,
      rgba(0, 0, 0, 0.16) 1px,
      transparent 1px,
      transparent 3px
    );
  opacity: 0.35;
  mix-blend-mode: multiply;
}

body::before {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  height: 34vh;
  top: -34vh;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0, 212, 255, 0.055), transparent);
  animation: scan-wash var(--scan-speed) linear infinite;
}

@keyframes scan-wash {
  from { transform: translateY(0); }
  to   { transform: translateY(160vh); }
}

/* --- cards become HUD panels --------------------------------------------
   Corner brackets instead of a full border: it reads as an instrument panel,
   and it leaves the card edge quieter than four glowing sides would. */

.card {
  position: relative;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--accent-cyan);
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.25s ease, width 0.25s ease, height 0.25s ease;
}

.card::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.card::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid;
  border-right: 2px solid;
}

.card:hover::before,
.card:hover::after {
  opacity: 1;
  width: 24px;
  height: 24px;
}

/* --- headings get a readout marker -------------------------------------- */

.card h2 {
  letter-spacing: 0.06em;
  text-shadow: 0 0 18px rgba(0, 212, 255, 0.35);
}

.card h2::before {
  content: "▸ ";
  color: var(--accent-cyan);
  opacity: 0.7;
}

.header h1 {
  text-shadow:
    0 0 24px rgba(0, 212, 255, 0.4),
    0 0 60px rgba(0, 212, 255, 0.15);
}

/* --- the output panel is a terminal, so let it look like one ------------- */

.output-wrap { position: relative; overflow: hidden; }

.output {
  position: relative;
  border: 1px solid var(--border-accent);
  box-shadow:
    inset 0 0 40px rgba(0, 212, 255, 0.07),
    var(--glow-cyan);
  background:
    linear-gradient(180deg, rgba(4, 10, 20, 0.96), rgba(6, 14, 26, 0.96));
}

/* A single sweep travelling down the config, slow enough to ignore. */
.output-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 90px;
  top: -90px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0, 212, 255, 0.07), transparent);
  animation: scan-wash 6s linear infinite;
}

/* --- syntax tokens, retuned to the theme -------------------------------- */

.tok-cmd  { color: var(--tok-cmd); text-shadow: 0 0 12px rgba(0, 212, 255, 0.4); }
.tok-ip   { color: var(--tok-ip); }
.tok-intf { color: var(--tok-intf); }
.tok-num  { color: var(--tok-num); }

.tok-warn {
  color: var(--tok-warn);
  text-shadow: 0 0 14px var(--accent-orange-glow);
}

.verify-list code { color: var(--accent-cyan); }
.verify-list li.verify-save code { color: var(--accent-orange); }

/* --- the notice reads as an alert, not a paragraph ---------------------- */

.notice {
  border-left: 3px solid var(--accent-orange);
  box-shadow: inset 0 0 40px rgba(249, 115, 22, 0.06);
}

.notice strong { color: var(--accent-orange); letter-spacing: 0.03em; }

/* --- template buttons --------------------------------------------------- */

.presets .btn {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.presets .btn:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

/* --- accessibility -------------------------------------------------------
   Everything above is atmosphere. Somebody who has asked their operating
   system to stop moving things has asked for a reason, and a person reading
   switch configuration is entitled to a still page. */

@media (prefers-reduced-motion: reduce) {
  .theme-bg::after,
  body::before,
  .output-wrap::after {
    animation: none;
  }
  body::before,
  .output-wrap::after { display: none; }
}

/* Small screens: the perspective floor eats vertical room that a phone does
   not have to spare, and the scanlines cost more than they give at that size. */
@media (max-width: 640px) {
  .theme-bg::after { height: 40vh; opacity: 0.5; }
  body::after { opacity: 0.2; }
}


/* ---------------------------------------------------------------------------
   Password-shaped fields that are NOT <input type="password">.

   Chromium's password manager keys off the input TYPE. A real password field
   gets a "save password?" bubble, lands in form history, and can be saved
   provisionally the moment the tab navigates. None of that is wanted for a
   value that exists for ten seconds on its way into a switch config.

   -webkit-text-security gives the same masking with none of that machinery.
   It is not in the CSS spec, but Chrome, Edge and Safari all implement it, and
   Firefox ships -moz-text-security. Where neither lands the field shows as
   plain text, which is a visible failure rather than a silent one -- the right
   way round for this.
   ------------------------------------------------------------------------ */

input.masked {
  -webkit-text-security: disc;
  -moz-text-security: disc;
  text-security: disc;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
}
