@tailwind components;

.repl {
  color: var(--text-color);
  background-color: var(--bg-color);
}

.repl-panel {
  position: relative;
  height: 100%;
}

.repl-tab-buttons {
  height: var(--repl-tab-height);
  font-size: 14px;
  overflow-x: auto;
  white-space: nowrap;

  background: linear-gradient(
    var(--repl-tab-bg-color) 0% calc(var(--repl-tab-height) - 14px),
    var(--bg-color) 40px var(--repl-tab-height)
  );
}

.repl-tab-buttons-inner {
  height: calc(var(--repl-tab-height) - 14px);
}

.repl-tab {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - var(--repl-tab-height));
}

.repl-input-panel {
  grid-area: repl-input-panel;
}

.repl-output-panel {
  grid-area: repl-output-panel;
}

.repl-detail-panel {
  grid-area: repl-detail-panel;
}

.repl-tab-button {
  display: inline-block;
  border-top: 4px solid transparent;
  height: calc(var(--repl-tab-height) - 22px);
  margin: 8px 0 0 0;
  padding: 0;
  min-width: 70px;
  text-align: center;
}

.repl-tab-button.active-tab {
  border-top-color: var(--repl-tab-button-active-border-color);
  background-color: var(--bg-color);
}

.repl-tab-button:not(.active-tab):hover {
  border-top-color: var(--repl-tab-button-hover-border-color);
  background-color: var(--repl-tab-button-hover-bg-color);
}

.repl-commands {
  float: right;
  padding: 8px 15px 0 15px;
  color: var(--repl-commands-color);
}

.repl-commands svg {
  width: 22px;
  height: 22px;
}

.repl-commands .copy-to-playground {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid;
  padding: 2px 8px;
  border-radius: 5px;
}

.repl-input-panel .repl-tab-button.active-tab {
  border-top-color: var(--repl-tab-button-input-active-border-color);
}

.repl-input-panel .repl-tab-button:not(.active-tab):hover {
  border-top-color: var(--repl-tab-button-input-hover-border-color);
}

.repl-detail-panel .repl-tab-button.active-tab {
  border-top-color: #4ce152;
}

.repl-detail-panel .repl-tab-button:not(.active-tab):hover {
  border-top-color: #4ce15275;
}

.repl-tab-diagnostics.active-tab {
  border-top-color: var(--repl-diagnostics-active-border-color);
}

.repl-tab-diagnostics.has-errors {
  color: red;
}

.repl-tab-diagnostics:not(.active-tab):hover {
  border-top-color: var(--repl-diagnostics-hover-border-color);
}

.repl-tab-button-select {
  padding: 3px 12px 4px 12px;
}

.repl-tab-button-close {
  padding: 5px 8px 5px 0;
  margin-left: 2px;
  opacity: 0.2;
}

.repl-tab-button-delete:hover {
  opacity: 1;
}

.repl-output-panel .repl-tab {
  background-color: var(--bg-color);

  font-family: Menlo, Monaco, 'Lucida Console', Consolas, 'Courier New', monospace;
  font-weight: normal;
  font-size: 12px;
  font-feature-settings:
    'liga' 0,
    'calt' 0;
  line-height: 18px;
  letter-spacing: 0px;
}

.output-result {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-color: var(--bg-color);
}

.output-result.output-app {
  pointer-events: none;
}

.output-result.output-app-active {
  z-index: 10;
  pointer-events: auto;
  display: block;
}

.output-app iframe {
  position: absolute;
  top: 0;
  left: 10px;
  width: calc(100% - 10px);
  height: 100%;
}

.repl-spinner {
  position: absolute;
  top: 0;
  left: 15px;
  width: 50px;
  height: 50px;
  animation: rotating 1s linear infinite;
  z-index: 10;
  stroke: var(--qwik-blue);
}

@keyframes rotating {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.editor-container {
  height: 100%;
}

.output-html {
  padding: 0 15px 15px 15px;
  height: 100%;
  overflow: auto;
}

.output-html pre {
  height: 100%;
}

.repl-mode-production .output-html {
  white-space: pre-wrap;
}

@layer components {
  .sm-grid-column {
    grid-template-columns: 100%;
  }
  .md-grid-column {
    grid-template-columns: minmax(200px, 25%) auto;
  }
}

.output-modules {
  display: grid;
  grid-template-areas: 'repl-file-tree repl-file-text';
  @media screen and (max-width: 768px) {
    grid-template-areas: 'repl-file-tree' 'repl-file-text';
  }

  height: 100%;
  overflow: hidden;
  @apply sm-grid-column;
  @apply md:md-grid-column;
}

.output-modules .file-tree {
  padding: 0 15px 15px 15px;
  grid-area: repl-file-tree;
  overflow-y: auto;
}

.output-modules .file-tree-header {
  font-weight: bold;
  margin-bottom: 5px;
}

.output-modules .file-tree-items a {
  display: block;
  margin: 4px 0px 2px 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.output-modules .file-tree-items a:hover,
.output-modules .file-tree-items a.in-view {
  color: var(--qwik-blue);
}

.output-modules .file-modules {
  padding: 0 15px 15px 0;
  grid-area: repl-file-text;
  overflow-y: auto;
  overflow-x: hidden;
}

.output-modules .file-item {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border: 1px solid rgb(33 104 170 / 15%);
  border-radius: 2px;
}

.output-modules .file-info {
  font-weight: bold;
  margin-bottom: 15px;
  background-color: rgb(33 104 170 / 15%);
  padding: 5px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.output-modules .file-size {
  font-weight: normal;
  color: var(--qwik-blue);
  padding-left: 8px;
}

.output-modules .file-text {
  padding-left: 10px;
  padding-right: 10px;
  overflow-x: auto;
}

.repl-mode-production .output-modules .file-text code {
  white-space: pre-wrap;
}

.output-diagnostics {
  color: var(--repl-diagnostics-text-color);
  font-weight: bold;
  padding: 0 15px 0 15px;
}

.output-diagnostics p {
  padding-bottom: 20px;
}

.output-diagnostics p.no-diagnostics {
  text-align: center;
  color: rgb(180, 180, 180);
  font-weight: normal;
}

.details-panel {
  grid-area: details-panel;
}

.details-tab-buttons {
  grid-area: details-tab-buttons;
}

.details-panel {
  grid-area: repl-details-panel;
}

.output-detail {
  padding: 0 15px 15px 15px;
}

.detail-options label {
  display: block;
  margin: 10px;
  font-size: 14px;
}

.detail-options label span {
  font-weight: bold;
  display: inline-block;
  width: 130px;
}

.detail-options select {
  border: 1px solid var(--repl-tab-bg-color);
  border-radius: 3px;
}

.log {
  font-size: 14px;
  border-bottom: 1px solid var(--repl-border-color);
  display: flex;
}

.log > .platform {
  width: 50px;
  text-align: center;
  padding: 5px 0;
  font-size: 12px;
  color: var(--repl-log-text);
}

.log > .platform.build {
  background: var(--repl-log-build);
}

.log > .platform.ssr {
  background: var(--repl-log-ssr);
}

.log > .platform.client {
  background: var(--repl-log-client);
}

.log > .platform.network {
  background: var(--repl-log-network);
}

.log.console-warn > .content {
  background: var(--repl-log-warning);
  font-weight: 500;
}

.log.console-error .content {
  background: #d90047;
  color: white;
}

.log.client-module > .content {
  font-family: monospace;
  font-size: 12px;
}

.log > .content {
  flex: 1;
  padding: 5px;
  line-break: anywhere;
  white-space: pre-wrap;
}

.line.paused,
.line.resumed {
  text-align: center;
  padding: 10px 0;
  font-size: 12px;
  font-weight: 700;
}

.line.paused {
  border-bottom: 2px solid var(--repl-border-color);
}

.line.resumed {
  border-top: 2px solid var(--repl-border-color);
}

.elapsed {
  border-radius: 5px;
  padding: 4px;
  font-size: 12px;
  background: #eeeeee;
  display: inline;
  height: max-content;
  margin: 0 5px;
}

.detail-logs {
  height: 100%;
  overflow: auto;
  padding-bottom: 100px;
}
