:root {
    /* Fallback values */
    --bg-workspace: #f8f9fa;
    --bg-toolbox:   #87CEFA;
    --softBlue-accent:  #2c6d9f;
    --secondary-color: #3b9396;
    --text-color:    #2d2d2d;
}

body {
    zoom: 0.9;
    margin: auto;
    font-family: sans-serif;
    height: 100vh;
    width: 95%;
    display: flex;
    flex-direction: column;
    overflow: auto;
    background-color: var(--bg-workspace);
    color: var(--text-color);
}

#loadingOverlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-workspace);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e0e0e0;
    border-top: 5px solid var(--softBlue-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#appTitle {
    color: var(--text-color);
    margin-right: 20px;
    font-size: 20px;
    text-align: center;
}

label {
    text-align: center;
    color: var(--text-color);
}

#mainAppContent {
    display: none;
    flex-direction: column;
    height: 100vh;
}

#pageContainer {
    width: 100%;
    height: 100%;
    overflow: hidden;            /* Changed to hidden to prevent double scrollbars */
    margin: auto;
    display: flex;
    flex-direction: column;      /* FOR HORIZONTAL: Change to 'row' */
    flex: 1;
}

#blocklyDiv {
    flex: 7 1 60%;
    width: 100%;
    overflow: hidden;
}

/* Resizer Bar Styles */
#resizer {
    background: var(--softBlue-accent);
    height: 6px;                /* FOR HORIZONTAL: Change to 100% height */
    /* width: 100%; */           /* FOR HORIZONTAL: Change to 10px width */
    cursor: ns-resize;           /* FOR HORIZONTAL: Change to ew-resize */
    transition: background 0.2s;
    z-index: 10;
    opacity: 0.3;
}

#resizer:hover {
    opacity: 1;
}

#outputPane {
    flex-grow: 1;
    flex-basis: 20%;             /* Ensures a minimum height of 20% */
    height: auto;
    overflow-y: auto;            /* Vertical scrolling */
    overflow-x: auto;            /* Enable horizontal scroll ONLY if a single word is too long */
    border-style: ridge;
    border-top: 2px solid var(--softBlue-accent);
    background: var(--bg-workspace);
    color: var(--text-color);
}

pre,
code {
    white-space: pre-wrap;       /* Maintains formatting but wraps text */
    overflow-wrap: normal;       /* Do not force-break words */
    word-break: keep-all;        /* Prevents breaking words in the middle */
    flex-grow: 1;
    margin: 0;                   /* Remove default pre margins */
    padding: 10px;
}

.setupSelector select {
    background-color: var(--bg-workspace);
    color: var(--text-color);
    border: 1px solid var(--softBlue-accent);
    padding: 5px;
    border-radius: 4px;
    cursor: pointer;
}

#auxiliar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

button {
    background-color: var(--softBlue-accent);
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

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

.btn {
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

#controls {
    background-color: var(--bg-toolbox);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 2px solid var(--softBlue-accent);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group input[type="number"] {
    width: 50px;
    padding: 5px;
    border: 1px solid var(--softBlue-accent);
    border-radius: 4px;
}

#resetInterval {
    width: 40px; 
    /*padding: 5px; */
    font-size: 14px;
    text-align: center;
}

