
:root {
    /* These vars are theme-invariant; everything else lives in [data-theme] */
    --accent: #4CAF50;
    --accent-dark: #2E7D32;
    --button-text: #E0E0E0;
    --button-text-shadow: #121212;
    --scrollbar-thumb: #4CAF50;
}

/* Light theme */
html[data-theme="light"] {
    --bg-page: #f5f5f5;
    --bg-surface: #e8e8e8;
    --bg-elevator: #c8c8c8;
    --bg-help: #e8f5e9;
    --bg-feedback: rgba(46, 125, 50, 0.1);
    --bg-floor-gradient: linear-gradient(
        rgba(46,125,50,0.03),
        rgba(46,125,50,0.07),
        rgba(46,125,50,0.11),
        rgba(46,125,50,0.03)
    );
    --text-primary: #212121;
    --text-shadow: #f5f5f5;
    --border-color: #cccccc;
    --accent-light: #388E3C;
    --accent-hover: #1B5E20;
    --accent-muted: rgba(46, 125, 50, 0.3);
    --color-emphasis: #2E7D32;
    --color-emphasis-shadow: #ccc;
    --color-error: #B71C1C;
    --color-user-happy: #2E7D32;
    --color-user-frustrated: #E65100;
    --color-user-disappointed: #B71C1C;
    --color-user-leaving: #616161;
    --inactive-faint: rgba(0, 0, 0, 0.2);
    --inactive-medium: rgba(0, 0, 0, 0.3);
    --scrollbar-track: #e0e0e0;
}

/* Dark theme */
html[data-theme="dark"] {
    --bg-page: #121212;
    --bg-surface: #1E1E1E;
    --bg-elevator: #000000;
    --bg-help: #293f29;
    --bg-feedback: rgba(71, 190, 80, 0.15);
    --bg-floor-gradient: linear-gradient(
        rgba(46,125,50,0.05),
        rgba(46,125,50,0.1),
        rgba(46,125,50,0.15),
        rgba(46,125,50,0.05)
    );
    --text-primary: #E0E0E0;
    --text-shadow: #121212;
    --border-color: #333333;
    --accent-light: #81C784;
    --accent-hover: #388E3C;
    --accent-muted: rgba(76, 175, 80, 0.2);
    --color-emphasis: #59ce5e;
    --color-emphasis-shadow: #333;
    --color-error: #CF6679;
    --color-user-happy: #81C784;
    --color-user-frustrated: #FFC107;
    --color-user-disappointed: #CF6679;
    --color-user-leaving: #A0A0A0;
    --inactive-faint: rgba(224, 224, 224, 0.2);
    --inactive-medium: rgba(224, 224, 224, 0.3);
    --scrollbar-track: #1E1E1E;
}

html, body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

body {
    font-family: monospace;
}

h1, h2, h3, h4, h5 {
    margin-top: 0.4em;
    margin-bottom: 0.3em;
}

h2, h3, h4, h5 {
    font-weight: normal;
}

.emphasis-color {
    color: var(--color-emphasis);
    text-shadow: 0 2px 0.4pt var(--color-emphasis-shadow);
}

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

a {
    color: var(--accent);
}

.container {
    width: 1220px;
    margin: 0 auto;
    padding: 20px 0 40px 0;
}

.unselectable {
    user-select: none;
}

button {
    height: 30px;
    line-height: 16px;
    font-size: 16px;
    font-family: monospace;
    padding-left: 16px;
    padding-right: 16px;
    color: var(--button-text);
    background-color: var(--accent-dark);
    text-shadow: 0 0 2px var(--button-text-shadow);
    border: 1px solid var(--accent);
    border-radius: 5px;
    margin-right: 5px;
}

button:hover {
    background-color: var(--accent-hover);
    cursor: pointer;
}

button:active {
    position: relative;
    top: 1px;
}

button.right {
    margin-left: 5px;
    margin-right: 0;
}

.blink {
    animation: blink 0.5s steps(3, start) infinite;
}
@keyframes blink {
    to { visibility: hidden; }
}

.invisible {
    visibility: hidden;
}

.faded {
    opacity: 0.4;
}

#save_message, #fitness_message {
    font-size: 12px;
    line-height: 30px;
}

#recommended-model-options {
    text-align: left;
    margin-bottom: 10px;
    overflow-x: hidden;
    font-size: 14px;
}

#other-model-options {
    text-align: left;
    margin-bottom: 10px;
    height: 150px;
    overflow-y: scroll;
    overflow-x: hidden;
    font-size: 14px;
}

.left {
    float: left;
}

.right {
    float: right;
}

.header {
    height: 60px;
    display: flex;
    justify-content: space-between;
}

.header h1 {
    line-height: 50px;
    margin: 0;
    padding: 0;
}

.header a {
    display: inline-block;
    margin-left: 15px;
    font-size: 20px;
    line-height: 50px;
    padding: 0 4px;
}

.timescale_decrease, .timescale_increase {
    padding: 4px;
    line-height: 20px;
    cursor: pointer;
}

.timescale_increase {
    margin-right: 10px;
}

.codestatus {
    padding-top: 10px;
}

.code {
    font: 14px Consolas, Monaco, monospace;
}

#editor {
    border: solid 1px darkgray;
    overflow: hidden;
    width: 1220px;
    height: 575px;
    margin: 10px auto;
}

.world {
    position: relative;
    width: 1220px;
    background-color: var(--bg-surface);
    padding: 0;
    overflow: hidden;
}

.innerworld {
    position: relative;
    height: 100%;
    width: 938px;
    border-right: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    font-family: Arial, Helvetica, sans-serif;
}

.statscontainer {
    font: 12px Consolas, Monaco, monospace;
    line-height: 10px;
    position: absolute;
    top: 0;
    right: 0;
    width: 240px;
    height: 110px;
    padding: 20px;
    z-index: 1;
}

.statscontainer div {
    border-bottom: 1px solid var(--accent);
}

.statscontainer div, .statscontainer span {
    position: absolute;
    display: block;
    width: 240px;
    height: 10px;
}

.statscontainer .value {
    text-align: right;
}

.feedbackcontainer {
    position: absolute;
}

.feedback {
    position: absolute;
    width: 1280px;
    height: 2000px;
    padding-top: 20px;
    line-height: 20px;
    text-align: center;
    background-color: var(--bg-feedback);
    z-index: 5;
    overflow: hidden;
}

.movable {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
}

.user {
    color: var(--text-primary);
    text-shadow: 0 1px 3px var(--text-shadow);
    z-index: 2;
}

.user.happy {
    color: var(--color-user-happy);
}

.user.frustrated {
    color: var(--color-user-frustrated);
}

.user.disappointed {
    color: var(--color-user-disappointed);
}

.user.leaving {
    color: var(--color-user-leaving);
}

.elevator {
    background-color: var(--bg-elevator);
    border: 2px solid var(--accent);
    height: 46px;
    z-index: 1;
}

.elevator .directionindicator {
    position: absolute;
    font-size: 10px;
    top: 3px;
}

.elevator .directionindicator.directionindicatorup {
    left: 2px;
}

.elevator .directionindicator.directionindicatordown {
    right: 2px;
}

.elevator .directionindicator .fa {
    color: var(--inactive-faint);
}

.elevator .directionindicator .fa.activated {
    color: var(--accent-light);
}

.elevator .floorindicator {
    display: inline-block;
    position: absolute;
    width: 100%;
    font-size: 15px;
    text-align: center;
    color: var(--inactive-medium);
}

.elevator .buttonindicator {
    display: inline-block;
    position: absolute;
    top: 15px;
    width: 95%;
    text-align: center;
    font-size: 8px;
    line-height: 8px;
    color: var(--inactive-medium);
}

.elevator .buttonpress {
    cursor: pointer;
    margin: 0;
    display: inline-block;
}

.elevator .buttonpress.activated {
    color: var(--accent-light);
}

.floor {
    position: absolute;
    width: 100%;
    height: 49px;
    background: var(--bg-floor-gradient);
    border-bottom: 1px solid var(--border-color);
}

.floor .buttonindicator {
    cursor: pointer;
    line-height: 50px;
    padding-left: 50px;
    color: var(--inactive-faint);
}

.floor .buttonindicator .activated {
    color: var(--accent-light);
}

.floor .floornumber {
    position: absolute;
    color: var(--accent-muted);
    font-size: 32px;
    line-height: 50px;
    padding-left: 10px;
}

.footer {
    margin-top: 20px;
}

.footer h4 {
    font-size: 13px;
}

#button_reset, #button_resetundo {
    background: none;
    border: none;
    color: var(--text-primary);
    text-shadow: 0 0 2px var(--text-shadow);
    font-size: 14px;
    padding: 4px 24px 4px 0px;
    cursor: pointer;
}

#button_reset:hover, #button_resetundo:hover {
    text-decoration: underline;
}

.bg-lighter {
    background-color: var(--bg-surface);
    padding: 0 8px;
}

.actions-container {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

#terminal-output {
    font-family: monospace;
    padding: 4px;
    min-height: 38px;
    max-height: 38px;
    overflow-y: scroll;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.fa-button:hover {
    color: #cccccc;
    position: relative;
    top: 1px;
    cursor: pointer;
}

.fa-button:active {
    position: relative;
    top: 2px;
    cursor: pointer;
}
