@keyframes blink { 50% { opacity: 0; } }
.blinking-cursor { animation: blink 1s step-end infinite; }

body.dark-theme::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 99999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background-color: var(--border-color); }

.terminal-button {
    border: 1px solid var(--border-color);
    background-color: var(--button-bg);
}
.terminal-button:hover {
    border-color: var(--button-hover-border);
    background-color: var(--button-hover-bg);
}

:root {
    --bg-color: #0D1117;
    --text-color: #c9d1d9;
    --primary-color: #56d364;
    --secondary-color: #58a6ff;
    --accent-color: #e3b341;
    --error-color: #f85149;
    --border-color: #30363d;
    --button-bg: #21262d;
    --button-hover-bg: #30363d;
    --button-hover-border: #8b949e;
    --table-header-bg: rgba(48, 54, 61, 0.8);
    --table-row-hover: rgba(139, 148, 158, 0.1);
}

.light-theme {
    --bg-color: #f1f5f9;
    --text-color: #1e293b;
    --primary-color: #166534;
    --secondary-color: #1d4ed8;
    --accent-color: #b45309;
    --error-color: #b91c1c;
    --border-color: #cbd5e1;
    --button-bg: #e2e8f0;
    --button-hover-bg: #cbd5e1;
    --button-hover-border: #64748b;
    --table-header-bg: rgba(226, 232, 240, 0.8);
    --table-row-hover: rgba(203, 213, 225, 0.5);
}

.c64-theme {
    --bg-color: #352879;
    --text-color: #8d83c2;
    --primary-color: #9ad2ff; /* Light Blue */
    --secondary-color: #ffffff; /* White */
    --accent-color: #e9e48a;  /* Yellow */
    --error-color: #8c4239;   /* Red */
    --border-color: #251869;
    --button-bg: #251869;
    --button-hover-bg: #6c5eb5;
    --button-hover-border: #9ad2ff;
    --table-header-bg: rgba(37, 24, 105, 0.8);
    --table-row-hover: rgba(108, 94, 181, 0.2);
}

.monochrome-theme {
    --bg-color: #0A1A0A;
    --text-color: #00FF00;
    --primary-color: #00FF00;
    --secondary-color: #33FF33;
    --accent-color: #99FF99;
    --error-color: #99FF99; /* Use a lighter green for errors to maintain monochrome */
    --border-color: #003300;
    --button-bg: #002200;
    --button-hover-bg: #004400;
    --button-hover-border: #00FF00;
    --table-header-bg: rgba(0, 51, 0, 0.8);
    --table-row-hover: rgba(0, 255, 0, 0.1);
}

/* --- Custom styles for inputs --- */
input[type="text"],
input[type="number"],
select {
    color: var(--text-color);
    caret-color: var(--primary-color);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    background-color: var(--button-hover-bg);
}

#additional-prompts {
    caret-color: var(--primary-color);
}
#additional-prompts:focus {
    outline: none;
}

/* Styles for resizable columns */
.results-table th {
    position: relative; 
}

.results-table thead {
  position: sticky;
  top: 0;
  z-index: 30;
}

.results-table thead th {
  position: sticky;
  top: 0;
  z-index: 31;
  background: var(--table-header-bg);
}

.results-table thead th .resizer {
  z-index: 32;
}

.resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    cursor: col-resize;
    user-select: none;
    height: 100%;
    z-index: 1;
}
.resizer:hover, .resizing {
    border-right: 2px solid var(--secondary-color);
}

.table-cell-editable {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
