/*
  Josh's Custom CSS Reset
  https://www.joshwcomeau.com/css/custom-css-reset/
*/
*, *::before, *::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  height: 100%;
}
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}
input, button, textarea, select {
  font: inherit;
}
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

#root, #__next {
  isolation: isolate;
}


iframe {
    border: 0;
}

h3 {
    font-weight:400;
}


/* SplashKit Online */
button {
    margin: 0px 3px;
    border-radius: 3px;
    border: 0;
    background-color: transparent;
    color: inherit;
    cursor: pointer;
    transition: color 0.4s, background-color 0.1s;
    line-height: 1em;
}
button:disabled {
    color: var(--disabled) !important;
}
#runtimeContainer .sk-header button:disabled, #codeViewContainer .sk-header button:disabled {
    cursor: wait;
}

button:hover:enabled {
    background-color: var(--shadowColour);
}

select {
    -webkit-appearance: button;
    -moz-appearance: button;

    margin: 0px 3px;
    border-radius: 3px;
    border: none;
    background-color: transparent;
    color: inherit;
    cursor: pointer;
    outline:none;
    line-height: 1em;
}

select:disabled {
    color: var(--disabled);
}

select:hover {
    background-color: var(--languageSelectBackground);
}

input {
    margin: 0px 3px;
    border-radius: 3px;
    border: 0;
    background-color: transparent;
    color: inherit;
    outline:none;
    line-height: 1em;
}



.sk-body {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0px;
    color: var(--primary);
    /* This gutter content needs to be kept as  */
    background-color: var(--gutterColour);

    display:flex;
    flex-direction: column;

    font-family: var(--font);
}

.sk-header {
    box-shadow: 0 1px 0 0.4px var(--shadowColour) inset;
    color: var(--primary);
    display: flex;
    list-style: none;
    margin: 0px;
    padding: 0px 10px 0px 0px;
    justify-content: space-between;
    height: 2em;
    line-height: 2em;
}

.sk-header-indent {
    padding-left: 1em;
}

.sk-menu {
    color: var(--primary);
    display: flex;
    list-style: none;
    padding: 0;
    justify-content: space-between;
    border-top: 1px var(--shadowColour) solid;
    min-width: 0;
}

.sk-menu li {
    display:flex;
    min-width: 0;
}

.sk-menu li *{
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.sk-tabs {
    display: flex;
    list-style: none;
    padding: 0;
    justify-content: space-between;
    color:var(--disabled);
    min-width: 0;
}
.sk-tabs li:hover {
    background-color: var(--languageSelectBackground);
}
.sk-tabs li {
    display:flex;
    padding: 0px 20px;
    border-top: 1px var(--shadowColour) solid;
    border-right: 1px var(--shadowColour) solid;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 0;
}
.sk-tabs li .sk-tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space:nowrap;
}

.sk-tabs-active {
    background-color: var(--editorBackgroundColour);
    box-shadow: none;
    z-index: 5;
    border-top: var(--activeTabColour) 1px solid !important;
    color: var(--primary);
}
.sk-tab-hidden {
    display: none;
}

.sk-tabs li[data-tab]::after {
    content: "\25BC";
    margin-left: 5px;
    visibility: hidden;  
    display: inline-block;   
}

.sk-tabs li[data-tab]:hover::after {
    visibility: visible;
}

.sk-contents {
    /* This background colour needs to be kept to ensure the easy of view of demo menu */
    background-color: var(--gutterColour);
    box-shadow: 0 0 0 1px var(--shadowColour);

    display:flex;
    flex-direction: column;
    flex-grow:1;
    color: var(--primary);
    min-height: 0;
}


.sk-contents-focusable:focus-within {
    box-shadow: 0 0 0 1px var(--activeTabColour);
    z-index:10;
}
textarea {
    outline: none;
}



.fade-on-create {
    animation: fadein .2s;
}
@keyframes fadein {
    from {
        opacity:0;
    }
    to {
        opacity:1;
    }
}

.sk-demo-window-container{
    width:100%;
    position:fixed;
    height:100%;
    z-index:1000;
    padding: 10% 20%;
    background-color: var(--demoThumbnailBackground);
}

.sk-demo-window{
    position:relative;
    height: 100%;
    margin:auto;
    pointer-events:initial;
}

.sk-demo-window-loading-text{
    position: absolute;
    margin: auto;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2em;
    text-align:center;
    z-index:100;
}

.sk-demo-thumbnail-grid-container{
    overflow: auto;
}

.sk-demo-thumbnail-grid{
    display: grid;
    gap: 20px;
    flex-direction: row;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    flex-grow: 0;
    margin-top:1em;
    margin-bottom:1em;
}

.sk-demo-tags{
    position:absolute;
    top:0px;
    left:0px;
    right:0px;
    background:none;
    justify-content: end;
    box-shadow: none;
}

.sk-demo-tag{
    background-color: var(--tagBackground);
    border-radius: 5px;
    color: var(--language);
    line-height: 1.5em;
    margin-top: 0.25em;
    padding: 0px 10px;
}

.sk-demo-title{
    position:absolute;
    bottom:0px;
    left:0px;
    right:0px;
    background-color:var(--demoTitleBackground);
    justify-content: center;
    color: var(--primary);
}

.sk-demo-thumbnail{
    overflow: hidden;
    box-shadow: var(--demoThumbnailBackground) 4px 4px 10px 0px;
    position:relative;
    transition: filter 0.1s;
    cursor:pointer;
}
.sk-demo-thumbnail:hover{
    filter:brightness(125%);
}

.sk-demo-thumbnail-img{
  aspect-ratio: 16/9;
  object-fit: contain;
  width: 100%;
}



.sk-main-columns {
    overflow: hidden;
    display: flex;
    flex-direction: row;
    flex-grow: 1;
}

.sk-column {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: 100%;
}

.gutter {
    display: flex;
    flex-direction: row;
    cursor: e-resize;
    z-index:100;
}

.gutter-vertical {
  cursor: ns-resize;
}

.gutter-horizontal {
  cursor: e-resize;
}

.sk-notification-area {
    position: absolute;
    right: 3em;
    left: 3em;
    bottom: 3em;
    z-index: 10;
    pointer-events: none;
}

.sk-notification-body {
    margin: 0px 5em 0px 1.5em;
    flex-grow: 1;
}

.sk-notification {
    box-shadow: var(--demoThumbnailBackground) 4px 4px 10px 0px;
    padding: 1em;
    display: flex;
    flex-direction: row;
    width: 30em;
    max-width: 100%;
    margin-top: 1em;
    transition: opacity 0.4s;
    opacity: 1;
    margin-left: auto;
    pointer-events: all;
}

.sk-notification.sk-contents-focusable:focus-within {
    box-shadow: 0 0 0 1px var(--activeTabColour), var(--demoThumbnailBackground) 4px 4px 10px 0px;
    z-index:10;
}

.sk-terminal {
    overflow-y: scroll;
    flex-basis: 0;
    border:0;
    padding-left:1em;
    resize: none;
    font-family: var(--editorFont);
    white-space: pre-wrap;
    background-color: var(--terminalBackground);
}

.sk-code-view-message {
    position:absolute;
    padding: 3em;
    transition: all 0.5s ease;
    opacity: 0;
    width:100%;
    height:100%;
    overflow: hidden;
}

.sk-terminal > :nth-child(2) {
    margin-top: auto !important;
}

#runProgram,
#collapsedRunProgram {
    color: var(--fileColour);
}

.sk-terminal-input-wrapper {
    padding: 0 1em;
    overflow: hidden;
    box-shadow: 4px 4px 10px var(--demoThumbnailBackground) inset;
    display: flex;
    font-family: monospace, serif;
    white-space: pre-wrap;
}
.sk-terminal-input-wrapper input {
    flex-grow: 1;
    margin: 0;
    padding: 0;
}

.node{
    color:var(--primary);
    cursor: pointer;
}
.node-label:hover{
    background-color:var(--nodeHover);
    cursor: pointer;
}
.node-label{
    width:100%;
    display:flex;
    flex-direction: row !important;
    padding: 0px 20px 0px 0px;
}
.node-label-text{
    flex: 1;
    padding: 0px 0px 0px 3px;
}
.node-button{
    background: none;
    border: none;
    color: var(--primary);
    padding: 0;
    margin: 0;
}
.node-button:hover{
    color: var(--iconHover);
}
.node-transient{
    opacity: 0.7;
    color: var(--transientColour);
}
.node-persistent{
    color: var(--primary);
}
.node-persistent.node-transient{
    color: var(--fileColour);
    opacity: 1.0;
}
.node-tentative-label{
	margin: 0px 6px 0px 6px;
}
.node-conflict{
	width:100%;
	display:flex;
    flex-direction: row !important;
	padding: 0px 20px 0px 0px;
	margin-left: 6px;
	color: var(--nodeConflict);
}
.node-conflict-text{
	flex: 1;
	padding: 0px 0px 0px 3px;
	text-wrap: nowrap;
}

.directory-contents{
    padding:00px 0px 0px 30px;
    transition: max-height 0.3s ease;
    overflow:hidden;
}


[class^="bi-"]::before, [class*=" bi-"]::before {
    line-height: inherit !important;
}


.in-drag{
    opacity:50%;
    cursor:grabbing !important;
    position:fixed;
}

.insertion-point-display{
    position:absolute;
    height:2px;
    background-color:var(--activeTabColour);
    opacity:100%;
    right:0px;
    left:0px;
}
.error-line{
    text-decoration-color: var(--errorColour) !important;
    text-decoration: underline wavy;
    background-color: var(--errorLineBackground);
}

/* make the CodeMirror theme match the rest of the UI a little more */
.cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters {
    background-color: var(--editorBackgroundColour) !important;
}


.CodeMirror-scrollbar-filler {
    background-color: var(--nodeHover) !important;
}
.CodeMirror-activeline-background {
    opacity: 0;
}
.CodeMirror-focused .CodeMirror-activeline-background {
    opacity: 0.5;
}

.CodeMirror-hints{
    position: absolute;
    z-index: 10;
    overflow: hidden;
    list-style: none;

    margin: 0;
    padding: 2px;

    -webkit-box-shadow: 2px 3px 5px var(--demoThumbnailBackground);
    -moz-box-shadow: 2px 3px 5px var(--demoThumbnailBackground);
    box-shadow: 2px 3px 5px var(--demoThumbnailBackground);
    border-radius: 3px;
    border: 1px solid silver;

    background-color: var(--nodeHover) !important;
    color: var(--primary) !important;
    font-size: 90%;
    font-family: monospace;

    max-height: 20em;
    overflow-y: auto;
    box-sizing: border-box;
    opacity:0.9;
}

.CodeMirror-hint{
    margin: 0;
    padding: 0 4px;
    border-radius: 2px;
    white-space: pre;
    color: var(--primary) !important;
    cursor: pointer;
}

li.CodeMirror-hint-active {
    background: var(--activeTabColour);
    color: var(--primary);
}

/* ensure widgets are above the text */
.CodeMirror-linewidget {
  z-index: 10;
}

/* New changes for scrollbar in FILES explorer section */

#fileViewContainer .sk-contents-focusable {
  overflow: auto;
}

/* Leftover stuff from bootstrap */

.btn-close {
  box-sizing: content-box;
  width: 1em;
  height: 1em;
  padding: 0.25em 0.25em;
  color: var(--nodeHover);
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
  border: 0;
  border-radius: 0.375rem;
  opacity: 0.5;
}
.btn-close:hover {
  color: var(--nodeHover);
  text-decoration: none;
  opacity: 0.75;
}
.btn-close:focus {
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  opacity: 1;
}
.btn-close:disabled, .btn-close.disabled {
  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  opacity: 0.25;
}

.btn-close-white {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.modal {
  --bs-modal-zindex: 1055;
  --bs-modal-width: 500px;
  --bs-modal-padding: 1rem;
  --bs-modal-margin: 0.5rem;
  --bs-modal-color: ;
  --bs-modal-bg: #fff;
  --bs-modal-border-color: var(--bs-border-color-translucent);
  --bs-modal-border-width: 1px;
  --bs-modal-border-radius: 0.5rem;
  --bs-modal-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --bs-modal-inner-border-radius: calc(0.5rem - 1px);
  --bs-modal-header-padding-x: 1rem;
  --bs-modal-header-padding-y: 1rem;
  --bs-modal-header-padding: 1rem 1rem;
  --bs-modal-header-border-color: var(--bs-border-color);
  --bs-modal-header-border-width: 1px;
  --bs-modal-title-line-height: 1.5;
  --bs-modal-footer-gap: 0.5rem;
  --bs-modal-footer-bg: ;
  --bs-modal-footer-border-color: var(--bs-border-color);
  --bs-modal-footer-border-width: 1px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--bs-modal-zindex);
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.modal-dialog {
  position: relative;
  width: 30%;
  margin: var(--bs-modal-margin);

  margin-right: auto;
  margin-left: auto;
}
.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translate(0, -50px);
}
@media (prefers-reduced-motion: reduce) {
  .modal.fade .modal-dialog {
    transition: none;
  }
}
.modal.show .modal-dialog {
  transform: none;
}
.modal.modal-static .modal-dialog {
  transform: scale(1.02);
}

.modal-dialog-scrollable {
  height: calc(100% - var(--bs-modal-margin) * 2);
}
.modal-dialog-scrollable .modal-content {
  max-height: 100%;
  overflow: hidden;
}
.modal-dialog-scrollable .modal-body {
  overflow-y: auto;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - var(--bs-modal-margin) * 2);
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  color: var(--bs-modal-color);
  pointer-events: auto;
  background-color: var(--bs-modal-bg);
  background-clip: padding-box;
  border: var(--bs-modal-border-width) solid var(--bs-modal-border-color);
  border-radius: var(--bs-modal-border-radius);
  outline: 0;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  width: 100vw;
  height: 100vh;
  background-color: var(--nodeHover);
}
.modal-backdrop.fade {
  opacity: 0;
}
.modal-backdrop.show {
  opacity: 0.5;
}

.modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: var(--bs-modal-header-padding);
  border-bottom: var(--bs-modal-header-border-width) solid var(--bs-modal-header-border-color);
  border-top-left-radius: var(--bs-modal-inner-border-radius);
  border-top-right-radius: var(--bs-modal-inner-border-radius);
}
.modal-header .btn-close {
  padding: calc(var(--bs-modal-header-padding-y) * 0.5) calc(var(--bs-modal-header-padding-x) * 0.5);
  margin: calc(-0.5 * var(--bs-modal-header-padding-y)) calc(-0.5 * var(--bs-modal-header-padding-x)) calc(-0.5 * var(--bs-modal-header-padding-y)) auto;
}

.modal-title {
  margin-bottom: 0;
  line-height: var(--bs-modal-title-line-height);
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: var(--bs-modal-padding);
}

#output > div:first-child {
    display: none;
}

.loading-container {
  display: flex;
  opacity: 0; /* hide by default */
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--demoThumbnailBackground);
  z-index: 1000;
  flex-direction: column;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.loading-bar {
  width: 50%;
  background-color: var(--editorBackgroundColour);
  border-radius: 25px;
  overflow: hidden;
}

.loading-progress {
  width: 0;
  height: 1.4em;
  background-color: var(--loadingBackground);
}

.loading-text {
  position: absolute; 
  top: 50%; 
  left: 50%; 
  transform: translate(-50%, -50%);
  color: var(--primary);
}

/* Modal UI changes */

.modal .sk-header {
  padding: 1.5em 1em; 
  display: flex; 
  align-items: center; 
}

.modal .sk-modal-footer {
  padding: 1.3em 1em; 
  display: flex; 
  align-items: center; 
  justify-content: flex-end; 
}

.btn {
  transition: background-color 0.3s, box-shadow 0.3s;
  box-shadow: 3px 3px 6px var(--demoThumbnailBackground);
  line-height: 1em;
  padding: 0.5em;
}

.btn:last-child {
  margin-right: 0;
}


.btn-secondary {
  color: var(--primary); 
}

.btn-success {
  color: var(--iconHover);
}

.btn-success:hover, .btn-success:focus {
  background-color: var(--nodeHover);
}

.flex-column {
    display: flex;
}

/* Canvas scaling fix */

#canvas {
  max-height: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  width: auto !important;
}

.sk-term-fmt-code1 {font-weight: bold;}
.sk-term-fmt-code3 {font-style: italic;}
.sk-term-fmt-code4 {text-decoration: underline;}
.sk-term-fmt-code9 {text-decoration: line-through;}
.sk-term-fmt-code21, .sk-term-fmt-code22 {font-weight: normal;}
.sk-term-fmt-code23 {font-style: normal;}
.sk-term-fmt-code24, .sk-term-fmt-code29 {text-decoration: none;}

.sk-term-fmt-code30, .sk-term-fmt-code90 {color: black;}
.sk-term-fmt-code31, .sk-term-fmt-code91 {color: red;}
.sk-term-fmt-code32, .sk-term-fmt-code92 {color: lime;}
.sk-term-fmt-code33, .sk-term-fmt-code93 {color: yellow;}
.sk-term-fmt-code34, .sk-term-fmt-code94 {color: blue;}
.sk-term-fmt-code35, .sk-term-fmt-code95 {color: magenta;}
.sk-term-fmt-code36, .sk-term-fmt-code96 {color: cyan;}
.sk-term-fmt-code37, .sk-term-fmt-code97 {color: white;}

.sk-collapsed-column {
  box-shadow: 0 1px 0 0.4px var(--shadowColour) inset;
  display: flex;
  flex-direction: column;
}

.sk-collapsed-column button {
  font-size: 1.1em;
  padding: 0.5em;
}

.sk-hidden {
  display: none !important;
}

.sk-header-title {
  text-wrap: nowrap;
}

.sk-minified .directory-contents {
  padding-left: 15px;
}

/* Run program button icons - join the gear and play icons together */
.run-program .bi-gear-fill {
  position: absolute;
  font-size: 0.5em;
  margin-left: -0.1em;
  margin-top: 0.64em;
  opacity: 0.5;
}

.sk-function-hint {
  opacity:0.8;
  z-index:100;
  width: initial;
  position: absolute;
  transform-origin: bottom;
  transform: translateY(-100%);
  padding:2px 10px;
  margin:0;
  transition: opacity 0.1s;
}

.sk-function-hint-overload-selector {
  text-align: center;
  font-size: 0.8em;
  display: flex;
  justify-content: end;
  flex-direction: column;
}

.sk-function-hint-inner {
  display: flex;
  justify-content: center;
  flex-direction: column;
}
