/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #f4f7fb 0%, #eef2ff 100%);
  color: #1f2937;
}

.page {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: 0;
  padding: 44px 28px 60px;
}

.hero {
  max-width: 1280px;
  margin: 0 auto;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4f46e5;
}

h1,
h2,
h3 {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 3.8vw, 3.3rem);
  line-height: 1.1;
}

.intro {
  max-width: 820px;
  margin: 0;
  color: #475569;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 30px;
  margin-top: 18px;
}

.pane {
  border: 1px solid #dbe4ff;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 45px rgba(79, 70, 229, 0.08);
}

.pane {
  min-height: 470px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pane-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #94a3b8;
  background: linear-gradient(135deg, #334155 0%, #475569 55%, #64748b 100%);
}

.pane-head-content {
  min-width: 0;
}

.pane-head p {
  margin: 0;
  color: #e0e7ff;
}

.pane-head h2 {
  margin-bottom: 6px;
  font-size: 1.12rem;
  color: #ffffff;
}

.meta-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.meta-toggle input {
  margin: 0;
  accent-color: #cbd5e1;
}

.live-surface,
.dom-surface {
  padding: 20px;
  min-height: 380px;
}

.demo-app {
  padding: 20px;
  border: 1px solid #dbe4ff;
  border-radius: 14px;
  background: #f8fafc;
}

.demo-title {
  margin-bottom: 8px;
}

.demo-description {
  margin-top: 0;
  color: #475569;
}

.task-list {
  margin: 14px 0;
  padding-left: 20px;
}

.task {
  padding: 4px 0;
}

.demo-button {
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: #4f46e5;
  color: #ffffff;
  font: inherit;
}

.is-selected-live {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
  background: #fffbeb;
}

.dom-tree-list {
  list-style: none;
  margin: 0;
  padding-left: 22px;
  position: relative;
}

.dom-tree-item {
  margin: 0;
  padding: 6px 0 0 14px;
  position: relative;
}

.dom-tree-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 14px;
  border-left: 1px solid #94a3b8;
  border-bottom: 1px solid #94a3b8;
}

.dom-tree-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  border-left: 1px solid #94a3b8;
}

.dom-tree-item:last-child::after {
  bottom: auto;
  height: 14px;
}

.dom-tree-root {
  padding-left: 0;
}

.dom-tree-item-root {
  padding-left: 0;
}

.dom-tree-item-root::before,
.dom-tree-item-root::after {
  display: none;
}

.dom-node {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  color: #334155;
  cursor: pointer;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.92rem;
}

.dom-node-tag {
  color: #0f172a;
  font-weight: 700;
}

.dom-node-id {
  color: #1d4ed8;
  font-size: 0.86rem;
  font-weight: 600;
}

.dom-node-classes {
  color: #64748b;
  font-size: 0.84rem;
}

.dom-node:hover {
  background: #eef2ff;
}

.is-selected-tree {
  background: #fef3c7;
  color: #78350f;
  font-weight: 700;
}

.is-selected-tree .dom-node-tag {
  color: #78350f;
}

.is-selected-tree .dom-node-id,
.is-selected-tree .dom-node-classes {
  color: #92400e;
}

.controls {
  margin-top: auto;
  padding: 22px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.controls-intro {
  margin-top: -2px;
  color: #64748b;
}

.controls-subsection {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
}

.controls-subsection h3 {
  margin-bottom: 6px;
}

.controls-subsection p {
  margin: 0 0 12px;
  color: #64748b;
}

.selection-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}

.selection-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-content: start;
}

.selection-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.92rem;
  grid-column: 1 / -1;
}

.selection-form .button {
  width: auto;
  min-width: 138px;
}

.selection-preview {
  display: grid;
  align-content: start;
}

.selection-preview h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.selection-preview pre {
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #dbe4ff;
  background: #0f172a;
  color: #e2e8f0;
  overflow-x: auto;
}

.operation-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: start;
}

.operation-field {
  display: grid;
  align-content: start;
}

.operation-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.92rem;
}

.operation-submit {
  align-self: end;
}

.operation-form input,
.operation-form select,
.selection-form input,
.button {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
}

.operation-form input,
.operation-form select,
.selection-form input {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
}

.operation-form input:focus,
.operation-form select:focus,
.selection-form input:focus {
  outline: 2px solid #c7d2fe;
  border-color: #818cf8;
}

.operation-form input:disabled,
.operation-form select:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.button {
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: #4f46e5;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  opacity: 0.95;
}

.execution-preview {
  margin-top: 16px;
}

.execution-preview h3 {
  margin-bottom: 8px;
}

.execution-preview pre {
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #dbe4ff;
  background: #0f172a;
  color: #e2e8f0;
  overflow-x: auto;
}

.operation-output {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.operation-output.is-success {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.operation-output.is-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

@media only screen and (max-width: 64em) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

@media only screen and (max-width: 48em) {
  .page {
    padding: 30px 14px 44px;
  }

  .operation-form {
    grid-template-columns: 1fr;
  }

  .selection-form {
    grid-template-columns: 1fr;
  }

  .selection-layout {
    grid-template-columns: 1fr;
  }

  .selection-form .button {
    width: 100%;
  }
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

