/*
 * This file contains utility classes and CSS variables.
 * In particular it contains colours used in retheming.
 */
/*
 * {
 box-sizing: border-box;
 margin: 0;
 padding: 0;
 font-family: Arial, sans-serif;
 }
 */
:root {
    --color-00000040: #00000040;
    --color-superscript-widget: #fff;
    --color-339: #339;
    --color-007acc: #007acc;
    --color-111: #111;
    --color-1110: #1110;
    --color-121212: #121212;
    --color-155724: #155724;
    --color-1a6: #1a6;
    --color-1c1: #1c1;
    --color-1e1e1e: #1e1e1e;
    --color-1e90ff: #1e90ff;
    --color-212121: #212121;
    --color-222: #222;
    --color-228822: #228822;
    --color-231: #231;
    --color-282828: #282828;
    --color-2c2f2f: #2c2f2f;
    --color-2fa32f: #2fa32f;
    --color-333: #333;
    --color-358039: #358039;
    --color-3a3a3a: #3a3a3a;
    --color-444: #444;
    --color-11d120: #11d120;
    --color-45a049: #45a049;
    --color-45f049: #45f049;
    --color-555: #555;
    --color-764: #764;
    --color-909090: #909090;
    --color-a82: #a82;
    --color-b0b0b0: #b0b0b0;
    --color-c4ddca: #c4ddca;
    --color-c9f: #c9f;
    --color-ccc: #ccc;
    --color-d4edda: #d4edda;
    --color-ddc: #ddc;
    --color-e88: #e88;
    --color-f0f0f0: #f0f0f0;
    --color-f88: #f88;
    --color-fd2: #fd2;
    --color-fdd: #fdd;
    --color-ffd: #0fd;
    --color-ffa500: #ffa500;
}

[data-theme="light"] {
    /* */
    /* :root { /**/
    --color-00000040: #ffffff40;
    --color-superscript-widget: #000;
    --color-339: #9696d3;
    /* main background colors */
    --color-111: #ccc;
    --color-222: #ddd;
    --color-333: #ccc;
    --color-444: #bbb;
    /* main text */
    --color-ddc: #340;
    /* emphasised text */
    --color-f88: #f33;
    /* button fill and box border*/
    --color-555: #aaa;
    /* high-contrast line around boxes */
    --color-ccc: #111;
    /* turnbuckle h3s */
    --color-45a049: #45a049;
    --color-45f049: #258029;
    /* h1 background */
    --color-231: #7f5930;
    /* chevron background and text and highlight */
    --color-155724: #3dc35c;
    --color-d4edda: #387346;
    --color-c4ddca: #1f3f0f;
    /* 'example' text (code) */
    --color-ffa500: #ae5b13;
    --color-007acc: #007acc;
    --color-1110: #1110;
    --color-121212: #121212;
    --color-1a6: #1a6;
    --color-1c1: #1c1;
    --color-1e1e1e: #1e1e1e;
    --color-1e90ff: #1e90ff;
    --color-212121: #212121;
    --color-228822: #228822;
    --color-2c2f2f: #2c2f2f;
    --color-2fa32f: #2fa32f;
    --color-358039: #358039;
    --color-3a3a3a: #3a3a3a;
    --color-764: #764;
    --color-909090: #909090;
    --color-a82: #a82;
    --color-b0b0b0: #b0b0b0;
    --color-c9f: #c9f;
    --color-e88: #e88;
    --color-f0f0f0: #f0f0f0;
    --color-fd2: #fd2;
    --color-fdd: #fdd;
    --color-ffd: #ffd;
}

body {
    /*padding: 20px;*/
    align-items: center;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    margin: 20px;
}

p {
    margin-block-end: 0px;
    margin-block-start: 0px;
}

/*
 * Responsive adjustments
 */
@media (max-width: 600px) {
    .dropdown-container {
        flex: 1 0 100%;
    }

    button {
        flex: 1 0 calc(50% - 5px);
    }
}

select {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    padding: 10px;
    width: 100%;
}

button {
    background-color: #4CAF50;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    flex: 1 0 auto;
    font-size: 16px;
    min-width: 80px;
    padding: 10px 15px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

h1 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

label {
    color: #555;
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

/* 
 * sometimes a div must stand in for a label...
 * Chrome for example objects to labels used with user-created widgets that
 * it does not recognise as form elements.
 * We ensure label class has the same style as an actual label.
 */
.label {
    color: #555;
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}
/*
 * Known safari issues with black scroolbars
 */
textarea {
    /* Force Safari to respect custom scrollbar colors */
    -webkit-appearance: none;
}

/*
 * Custom scrollbar styling for WebKit browsers
 */
textarea::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: #555;
}




.code {
    color: var(--color-ffa500);
    /* Fixed-width font */
    font-family: monospace;
}

.panel {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px #00000019;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: 0 auto;
    max-width: 800px;
    padding: 20px;
}

/*
+ * Slider container takes full width
+ */
.slider-container {
    flex: 1 0 100%;
    margin-top:40px;
    /*margin-bottom: 10px;*/
}

/*
+ * Styling for the slider
+ */
.slider {
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 4px;
    height: 8px;
    outline: none;
    width: 100%;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    height: 20px;
    width: 20px;
}

.slider::-moz-range-thumb {
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    height: 20px;
    width: 20px;
}

/*
 * For the left/right slider
 */
.toggle-container {
    background-color: #eee;
    border-radius: 30px;
    cursor: pointer;
    display: inline-flex;
    padding: 3px;
    position: relative;
}

.toggle-option {
    padding: 10px 20px;
    text-align: center;
    user-select: none;
    z-index: 1;
}

.toggle-option.active {
    color: #fff;
}

.toggle-slider {
    background-color: #4a6fa5;
    border-radius: 30px;
    height: calc(100% - 6px);
    left: 3px;
    position: absolute;
    top: 3px;
    transition: transform 0.3s ease;
    width: calc(50% - 6px);
}

.toggle-slider.right {
    transform: translateX(100%);
}

.row-container {
    flex: 1 0 100%;
    margin-bottom: 0px;
}


.flex-break {
    flex: 1 0 100%;
    margin: 0px;
}

.sections {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.list-container {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
}


.list-container button {
    background-color: #90b090;
    border: none;
    border-radius: 4px;
    color: black;
    cursor: pointer;
    flex: 1 0 auto;
    font-size: 16px;
    min-width: 80px;
    padding: 10px 15px;
    text-align: left;
    transition: background-color 0.3s;
}

.instructions {
    background-color: #f0f7ff;
    border-left: 4px solid #0066cc;
    font-size: 0.95em;
    margin-bottom: 20px;
    padding: 15px;
}


.concept-card {
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 1px 3px #00000019;
    flex: 1 0 calc(25% - 15px);
    min-width: 200px;
    padding: 15px;
}

.concept-name {
    color: #333;
    font-weight: bold;
    margin-bottom: 10px;
}

.concept-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option {
    align-items: center;
    display: flex;
    gap: 8px;
}
.option input {
  margin: 0;
}

.button-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.results-container {
    display: none;
    margin-top: 30px;
}

.results-heading {
    color: #333;
    font-size: 1.2em;
    margin-bottom: 15px;
}

.results-json {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    height: 150px;
    padding: 10px;
    width: 100%;
}
.progress-indicator {
    color: #666;
    margin-bottom: 20px;
    text-align: center;
}

.stage-indicator {
    color: #0066cc;
    font-weight: bold;
}

.diagnostic-container {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: none;
    font-family: monospace;
    font-size: 12px;
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    white-space: pre-wrap;
}

.concept-header {
    align-items: center;
    display: flex;
    margin-bottom: 10px;
}
.info-icon {
    background-color: #0066cc;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: inline-block;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: bold;
    height: 14px;
    line-height: 14px;
    margin-left: 8px;
    margin-top: -17px;
    min-width: 0px;
    padding: 0px 0px;
    position: relative;
    text-align: center;
    width: 14px;
}

.tooltip {
    background-color: #333;
    border-radius: 4px;
    color: white;
    font-size: 12px;
    font-weight: normal;
    left: 50%;
    max-width: 200px;
    opacity: 0;
    padding: 6px 10px;
    position: absolute;
    top: -40px;
    transform: translateX(-50%);
    transition: opacity 0.3s;
    visibility: hidden;
    white-space: nowrap;
    width: max-content;
    z-index: 10;
}
.info-icon:hover {
    background-color: #000077;
}

.info-icon:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.tooltip::after {
    border-color: #333 transparent transparent transparent;
    border-style: solid;
    border-width: 5px;
    content: "";
    left: 50%;
    margin-left: -5px;
    position: absolute;
    top: 100%;
}


.ascii-art {
    background-color: #f5f5f5;
    border-radius: 5px;
    display: block;
    font-family: monospace;
    margin-bottom: 20px;
    padding: 15px;
    text-align: left;
    white-space: pre;
}



.slider-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: -6px;
    margin-top: -15px;
}

.progress {
    flex: 1 0 auto;
    margin: 20px 0;
}

.progress-bar {
    background-color: #e0e0e0;
    border-radius: 15px;
    height: 30px;
    overflow: hidden;
    user-select: none;
    width: 100%;
}

.progress-fill {
    /*background: linear-gradient(90deg, #4CAF50, #8BC34A);*/
    align-items: center;
    background: #4CAF50;
    color: white;
    display: flex;
    font-weight: bold;
    height: 100%;
    justify-content: center;
    transition: width 0.3s ease;
    width: 0%;
}




.label-container {
    display: flex;
    flex: 1;
    justify-content: center;
    text-align: center;
}

.value-display {
    font-weight: normal;
    margin-left: 5px;
}

.min-label {
    color: #666;
    font-size: 0.8rem;
    text-align: left;
    width: 50px;
}

.max-label {
    color: #666;
    font-size: 0.8rem;
    text-align: right;
    width: 50px;
}





/*
 * Dropdown styling
 */
.dropdown-container {
    flex: 1 0 200px;
}

/*
 * Button row container
 */
.button-container {
    display: flex;
    flex: 1 0 100%;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}



.raw {
    /*display: block;*/
    /*unicode-bidi: embed;*/
    background-color: var(--color-444);
    border-color: var(--color-ccc);
    border-radius: 3px;
    border-style: solid;
    border-width: 1px;
    font-family: monospace;
    font-size: -2;
    padding: 8px;
    visibility: visible;
    white-space: pre-wrap;
}

.raw p {
    margin-bottom: 0px;
    margin-top: -20px;
}


/*
 * Safari-specific styles
 */
::-webkit-scrollbar {
    background-color: var(--color-333);
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background-color: var(--color-111);
}

.container {
    display: flex;
    height: calc(100vh - 1em);
    user-select: none;
}

.column {
    border: 1px solid var(--color-555);
    flex-basis: 33.33%;
    overflow: auto;
    padding: 10px;
    scrollbar-color: var(--color-111) var(--color-444);
    scrollbar-width: thin;
    transition: flex-basis 0.1s;
}

.resizer {
    border-left: 1px solid var(--color-444);
    border-right: 1px solid var(--color-444);
    cursor: ew-resize;
    width: 5px;
}

.canvas-container {
    border: 1px solid #ccc;
    margin-bottom: 20px;
}

.checkbox-row-container {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-option-column {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.checkbox-option-row {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.text-input {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    min-height: 200px;
    padding: 15px;
    resize: vertical;
    transition: border-color 0.3s;
    width: 100%;
}

.text-input:focus {
    border-color: #667eea;
    outline: none;
}

.tree-container {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-width: 600px;
    padding: 10px;
}

.tree-node {
    margin: 0;
    padding: 0;
    position: relative;
}

.tree-row {
    align-items: flex-start;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    padding: 4px 0;
    position: relative;
    transition: background-color 0.15s;
}

.tree-row:hover {
    background-color: #f0f0f0;
}

.tree-row::before {
    border-bottom: 1px solid #ccc;
    border-left: 1px solid #ccc;
    content: '';
    height: 50%;
    left: 10px;
    position: absolute;
    top: 0;
    width: 10px;
}

.tree-node.root>.tree-row::before {
    display: none;
}

.tree-node::after {
    background: #ccc;
    content: '';
    height: 100%;
    left: 10px;
    position: absolute;
    top: 0;
    width: 1px;
}

.tree-node.root::after {
    display: none;
}

.tree-node.last::after {
    display: none;
}

.tree-indent {
    flex-shrink: 0;
}

.tree-toggle {
    align-items: center;
    background: white;
    color: #666;
    display: flex;
    flex-shrink: 0;
    font-size: 12px;
    height: 20px;
    justify-content: center;
    position: relative;
    user-select: none;
    width: 20px;
    z-index: 1;
}

.tree-toggle.empty {
    visibility: hidden;
}

.tree-content {
    flex: 1;
    line-height: 1.4;
    padding: 2px 4px;
    word-wrap: break-word;
}

.tree-children {
    margin-left: 20px;
    position: relative;
}

.tree-children.collapsed {
    display: none;
}