:root {
  --inWidth: 50%;
  --outWidth: calc(100% - var(--inWidth));
  --height: calc(70% - 12px);
  --consoleHeight: calc(100% - var(--height));
  --console-bg: #1a1a1a;
  --console-text: #e0e0e0;
  --console-border: #444;
  --console-control-bg: #2a2a2a;
  --console-button-bg: transparent;
  --console-button-text: #e0e0e0;
  --console-button-border: #666;
  --console-button-hover-bg: #3a3a3a;
  --console-button-active-bg: #007bff;
  /* Blue for active filter */
  --console-button-active-text: #ffffff;
  --console-input-bg: #333;
  --console-input-text: #e0e0e0;
  --console-input-border: #666;

  /* Log level colors */
  --log-color: #e0e0e0;
  /* Light grey */
  --info-color: #0077FF;
  /* Vibrant Blue */
  --warn-color: #FFA500;
  /* Orange */
  --error-color: #FF6347;
  /* Tomato */
}

.custom-console {
  display: flex;
  flex-direction: column;
  /* rounded-lg */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  /* shadow-lg */
  width: 100%;
  height: 400px;
  /* Fixed height for the console area */
  background-color: var(--console-bg);
  color: var(--console-text);
  font-family: monospace;
  font-size: 14px;
  border: 1px solid var(--console-border);
  box-sizing: border-box;
}

.custom-console>button {
  border-radius: none;
}

.console-controls {
  padding: 0.3rem;
  /* p-3 */
  border-bottom: 1px solid var(--console-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--console-control-bg);
}

.filter-button,
.clear-button {
  padding: 0.25rem 0.75rem;
  /* px-3 py-1 */
  /* rounded-md */
  border: 1px solid var(--console-button-border);
  font-size: 0.875rem;
  /* text-sm */
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: var(--console-button-bg);
  color: var(--console-button-text);
}

.filter-button:hover,
.clear-button:hover {
  background-color: var(--console-button-hover-bg);
}

.filter-button.active {
  background-color: var(--console-button-active-bg);
  color: var(--console-button-active-text);
  border-color: var(--console-button-active-bg);
}

.text-filter-input {
  padding: 0.5rem;
  /* p-2 */
  border-radius: 0.375rem;
  /* rounded-md */
  font-size: 0.875rem;
  /* text-sm */
  background-color: var(--console-input-bg);
  color: var(--console-input-text);
  border: 1px solid var(--console-input-border);
}

.console-output {
  flex-grow: 1;
  overflow-y: auto;
  padding: 0.75rem;
  /* p-3 */
}

.log-entry:not(details) {
  margin-bottom: 0.25rem;
  /* mb-1 */
  padding: 0.25rem;
  /* p-1 */
  border-radius: 0.25rem;
  /* rounded-sm */
  border-bottom: 1px dotted var(--console-border);
  word-break: break-word;
  /* Ensure long words break */
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry.log {
  color: var(--log-color);
}

.log-entry.info {
  color: var(--info-color);
}

.log-entry.warn {
  color: var(--warn-color);
}

.log-entry.error {
  color: var(--error-color);
}

.timestamp {
  color: var(--console-text);
  margin-right: 0.5rem;
}

.log-entry span {
  display: inline;
  /* Ensure spans don't create new lines unnecessarily */
}

.log-entry span[data-type="null"],
.log-entry span[data-type="undefined"] {
  color: #808080;
}

.log-entry span[data-type="string"],
.log-entry span[data-type="number"],
.log-entry span[data-type="boolean"],
.log-entry span[data-type="object-summary"],
.log-entry span[data-type="html-element"],
.log-entry span[data-type="error-object"] {
  color: inherit;
}

.log-entry details {
  margin-left: 0.5rem;
  /* ml-2 */
  border-left: 1px solid var(--console-border);
  padding-left: 0.3125rem;
  /* padding-left: 5px; */
}

.log-entry summary {
  cursor: pointer;
  color: inherit;
}

.log-entry pre {
  padding: 0.5rem;
  /* p-2 */
  border-radius: 0.375rem;
  /* rounded-md */
  overflow-x: auto;
  background-color: var(--console-input-bg);
  white-space: pre-wrap;
  word-break: break-word;
  color: inherit;
}

.log-entry table {
  width: 100%;
  margin-top: 0.5rem;
  /* my-2 */
  margin-bottom: 0.5rem;
  /* my-2 */
  border-collapse: collapse;
  color: inherit;
}

.log-entry th,
.log-entry td {
  padding: 0.5rem;
  /* p-2 */
  text-align: left;
  border: 1px solid var(--console-button-border);
}

.log-entry th {
  background-color: #2d3748;
  /* bg-gray-700 */
}

/* Specific styling for group details */
.log-entry.group-details {
  border-bottom: none;
  /* No border for group entries themselves */
  margin-bottom: 0;
}


body {
  overflow: hidden;
  margin: 0;
}

#helper,
#verticalHelper {
  transform: translate(-50%, -50%);
  position: fixed;
  height: 400px;
  width: 400px;
  top: -1000px;
  z-index: 2147483647;
  /* backdrop-filter: invert(); */
}

#helper {
  cursor: ew-resize;
}

#verticalHelper {
  cursor: ns-resize;
}

#head {
  border-bottom: 1px #131419 solid;
  background-color: #1E2028;
  width: 100vw;
  height: 40px;
  display: flex;
  place-content: center;
}


#name {
  color: #ffffff;
  left: 0;
  font-size: 35px;
  position: absolute;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  background-color: transparent;
  height: 36px;
  outline: none;
  border: none;
  resize: none;
  padding: 0 7px 0 2px;
  display: inline-block;
  white-space: nowrap;
  min-width: 90%;
  margin-right: 6px;
}

#name:focus {
  border-bottom: 1px solid #0077FF;
}

#nav {
  background-color: #161A22;
  /* Vertically align items in the nav */
  align-items: center;
  /* Ensure tabs are in a row */
  display: flex;
  width: 100vw;
  height: 40px;
}

#nav #stuff {
  justify-content: center;
  position: absolute;
  display: flex;
  padding: 6px;
  right: 0;
}

#nav button#fileCreator {
  background-color: transparent;
  anchor-name: --fileCreator;
  border-radius: 200px;
  margin-right: 10px;
  font-weight: 900;
  aspect-ratio: 1;
  font-size: 28px;
  aspect-ratio: 1;
  color: white;
  border: none;
  width: 33px;
}

#nav button#fileCreator:hover {
  background-color: #343745;
}

#nav .tab-container {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: scroll;
  overflow-y: hidden;
  width: calc(100vw - 100px);
  /* Arrange tabs horizontally */
}

#nav .tab {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  flex-grow: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  border-bottom: none;
  margin-right: 5px;
  padding: 8px 15px;
  color: #7B7B7B;
  cursor: pointer;
}

.tab input {
  color: white;
}

.tab input::selection {
  background-color: rgba(255, 255, 255, 0.8);
  color: black;
}

#nav .tab.active,
#nav .tab:hover {
  border-bottom: #5063F0 1px solid;
  color: white;
}

#nav .tab button.close-tab {
  margin-left: 10px;
  background: none;
  cursor: pointer;
  font-size: 1em;
  border: none;
  padding: 0;
}

#main {
  background-color: #5063F0;
  height: calc(100% - 80px);
  position: absolute;
  width: 100%;
}

#input {
  width: calc(var(--inWidth) - 5px);
  background-color: black;
  position: absolute;
  height: 100%;
  left: 0;
}

#browser {
  width: calc(var(--outWidth) - 5px);
  position: absolute;
  background-color: aqua;
  height: 100%;
  right: 0;
}

#output {
  background-color: white;
  height: var(--height);
  position: absolute;
  width: 100%;
  right: 0;
}

#console {
  background-color: lightgrey;
  height: var(--consoleHeight);
  position: absolute;
  width: 100%;
  bottom: 0;
  overflow-y: hidden;
}

#divider {
  left: calc(var(--inWidth) - 6px);
  background-color: #343745;
  position: absolute;
  cursor: ew-resize;
  height: 100%;
  width: 12px;
}

#divider:hover,
#divider:active,
#verticalDivider:hover,
#verticalDivider:active {
  background-color: #2096F3;
}

#newFile {
  inset: auto;
  /* Or could be with box model */
  position: absolute;
  top: anchor(bottom);
  left: anchor(left);
  position-anchor: --fileCreator;
  border: none;
  border-radius: 3px;
  box-shadow: 2px 2px 10px 3px rgba(0, 0, 0, 0.3);
}

.option {
  background-color: transparent;
  text-align: start;
  font-size: 18px;
  display: block;
  padding: 5px;
  border: none;
  width: 100%;
}

.option:hover {
  background-color: #F5F5F5;
}

.file {
  display: none;
  /* Initially hide all files */
  width: 100%;
  /* Make sure they take full width of the input area */
  height: 100%;
  /* Make sure they take full height of the input area */
}

.file.active {
  display: block;
  /* Show the active file */
}

.settings {
  display: inline-block;
}

.tab:hover>.settings>* {
  visibility: visible;
}

.settings>* {
  background-color: transparent;
  visibility: hidden;
  cursor: pointer;
  color: #707070;
  border: none;
}

.rename-input {
  background-color: transparent;
  font-family: inherit;
  font-size: inherit;
  border: none;
  width: 80px;
  /* Adjust as needed */
}

.rename-input.rename-error {
  border: 1px solid red;
}

#run {
  transition: background-color 200ms;
  background-color: transparent;
  border: 1px solid #B4D883;
  font-weight: bolder;
  align-self: center;
  border-radius: 2px;
  font-size: large;
  color: white;
}

#run:hover {
  background-color: #B4D883;
}

#editorSettings {
  position: absolute;
  right: 0;
  align-self: center;
}

i {
  font-size: 20px;
  color: white;
}

button {
  background-color: transparent;
  border: 0;
}

#verticalDivider {
  background-color: #343745;
  cursor: ns-resize;
  height: 12px;
  width: 100%;
}

#verticalHelper:hover~#browser #console #verticalDivider {
  background-color: #2096F3;
}


#outputFrame {
  border: none;
  width: 100%;
  height: 100%;
}

#globalSettings {
  color: #CCCCCC;
  border-radius: 3px;
  border: 5px solid #2F323F;
  background-color: #161A22;
  width: 80%;
  height: 80%;
}

#globalSettings::backdrop {
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
}

.switch {
  background-color: #CCCCCC;
  position: relative;
  display: inline-block;
  width: 45px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked+.slider {
  background-color: #2196F3;
  /* Blue background when checked */
}

input:focus+.slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked+.slider:before {
  transform: translateX(25px);
  /* Move the toggle to the right */
}

.compiler-button {
  border-radius: 3px;
  border: 1px solid #2096F3;
  transition: background-color 0.3s;
  color: white;
  position: relative;
}

.compiler-button:hover,
.compiler-button:active {
  background-color: #50ADF6;
}

.upload-area {
  width: 300px;
  height: 200px;
  border: 2px dashed #ccc;
  text-align: center;
  line-height: 200px;
  font-size: 18px;
  color: #666;
  border-radius: 10px;
  cursor: pointer;
}

.upload-area.dragover {
  border-color: #4CAF50;
  background-color: #f0f8f0;
  color: #4CAF50;
}

.file-input-btn {
  display: none;
}

.pencil {
  color: #808080;
  font-size: 0.85rem;
}

.pencil:hover {
  color: #ffffff;
}

.container-div::-webkit-scrollbar { height: 8px; background: transparent; }
.container-div::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; }
.container-div { scrollbar-width: thin; scrollbar-color: #888 transparent; }
