@charset "UTF-8";

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "JetBrains Mono", monospace;
  background: #0b1220;
  color: #dbe2f1;
}

input,
textarea,
button,
pre {
  font-family: "JetBrains Mono", monospace;
  font-weight: 400;
  font-style: normal;
}

body {
  display: grid;
  grid-template-rows: auto 1fr;
}

header.top {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f1b33;
  border-bottom: 1px solid #1e2a44;
  padding: 14px 20px;
}

header.top h1 {
  margin: 0;
  font-size: 18px;
}

header.top .logo {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 8px;
}

.main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: 8px 16px;
  padding: 20px;
  min-height: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-header p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 1px;
  color: #8fa0c8;
}

.preview-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Monaco editor containers */
.editor {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #22304a;
  background: #0a1224;
  padding: 0;
}

/* Grid placement */
#input-editor { grid-column: 1; grid-row: 2; }
#output-editor { grid-column: 2; grid-row: 2; }

button {
  background: transparent;
  border: 1px solid #2a3a5e;
  color: #dbe2f1;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

button:hover {
  background: #162447;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  color: #b8c0d9;
  position: relative;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle .track {
  width: 36px;
  height: 18px;
  background: #1e293b;
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle .thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #e5e7eb;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle input:checked + .track {
  background: #5b7cfa;
}

.toggle input:checked + .track .thumb {
  transform: translateX(18px);
}

.toggle input:focus-visible + .track {
  box-shadow: 0 0 0 2px rgba(91, 124, 250, 0.6);
}

button.copy-success {
  border-color: #22c55e;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: copy-success-pulse 0.4s ease;
}

button.copy-error {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: copy-error-pulse 0.4s ease;
}

@keyframes copy-success-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    transform: scale(1);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    transform: scale(1);
  }
}

@keyframes copy-error-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    transform: scale(1);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    transform: scale(1);
  }
}
