@font-face {
    font-family: 'League Spartan';
    src: url('fonts/LeagueSpartan-Regular.woff2') format('woff2'),
         url('fonts/LeagueSpartan-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'League Spartan';
    src: url('fonts/LeagueSpartan-Light.woff2') format('woff2'),
         url('fonts/LeagueSpartan-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'League Spartan';
    src: url('fonts/LeagueSpartan-Medium.woff2') format('woff2'),
         url('fonts/LeagueSpartan-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'League Spartan';
    src: url('fonts/LeagueSpartan-SemiBold.woff2') format('woff2'),
         url('fonts/LeagueSpartan-SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'League Spartan';
    src: url('fonts/LeagueSpartan-Bold.woff2') format('woff2'),
         url('fonts/LeagueSpartan-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
body {
    font-family: 'League Spartan', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.container > #messages {
    margin-left: 30px;
    margin-right: 30px;
    /* Keep existing margins for top/bottom */
    margin-top: 10px;
    margin-bottom: 10px;
}

h1 {
    color: #333;
    margin-bottom: 30px;
}

h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 400;
}

.input-section,
.output-section {
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    height: 300px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
}

/* Editor styles */
.editor-container {
    resize: none;
    overflow: hidden;
    border: 1px solid #ccc;
    min-height: 200px;
    min-width: 300px;
    max-height: 100vh;
    max-width: 100%;
}

#editor {
    width: 100%;
    height: 400px;
    border: 1px solid #ccc;
    font-family: monospace;
    box-sizing: border-box;
}

/* Consistent section spacing */
.file-input,
.instructions-section,
.editor-options-section, 
.hardware-options-section,
.output-controls,
.output-text-section,
.download-buttons {
    margin-bottom: 20px;
}

/* Button group spacing */
.file-input + .editor-options-section,
.editor-container + div,
h2 + div {
    margin-top: 6px;
}

/* All collapsible section headers */
.instructions-section h3,
.editor-options-section h3,
.hardware-options-section h3,
.output-text-section h3 {
    margin-bottom: 10px;
    margin-top: 0;
    font-size: 16px;
    font-weight: 400;
    color: #333;
    padding: 0;
}

/* All toggle arrows */
#instructionsToggle,
#editorOptionsToggle,
#hardwareOptionsToggle,
#outputToggle {
    display: inline-block;
    transition: transform 0.3s ease;
    margin-right: 8px;
    width: 12px;
    text-align: center;
}

/* All collapsible content areas */
.instructions-content,
.editor-options-content,
.hardware-options-content,
.output-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    max-height: 1000px;
}

/* All collapsed states */
.instructions-content.collapsed,
.editor-options-content.collapsed,
.hardware-options-content.collapsed,
.output-content.collapsed {
    max-height: 0;
}

.output-content:not(.collapsed) {
    max-height: 500px;
}

/* Boxed content areas (instructions text and output controls) */
.instructions-text,
.options,
.output-controls {
    margin: 20px 0;
    padding: 10px 15px;
    background-color: #f8f8f8;
    border-radius: 4px;
}

.instructions-text {
    line-height: 1.6;
}

.instructions-text p {
    margin-bottom: 15px;
}

.instructions-text p:last-child {
    margin-bottom: 0;
}

.options {
    padding: 15px; /* Override for slightly more padding */
}

.options label {
    margin-right: 20px;
    display: inline-block;
}

/* Button styles */
button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

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

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Status message colors */
.error {
    color: red;
    margin-top: 10px;
}

.success {
    color: green;
    margin-top: 10px;
}

.warning {
    color: orange;
    margin-top: 10px;
}

/*#output {
    background-color: #f8f8f8;
    white-space: pre-wrap;
}*/

#output {
    background-color: #f8f8f8;
    white-space: pre; /* Changed from pre-wrap to preserve formatting without wrapping */
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    resize: none;
    box-sizing: border-box;
    width: 100%;
    height: 200px;
    overflow-x: auto; /* Add horizontal scroll instead of wrapping */
    overflow-y: auto;
    word-break: keep-all; /* Prevent breaking of hex values and assembly code */
}

.output-text-section {
    margin-top: 20px;
}

.editor-help-text {
    color: #888;
    padding-top: 6px;
    padding-left: 4px;
    margin-bottom: 8px;
    font-style: italic;
}

.shortcut {
    display: flex;               /* horizontal layout */
    justify-content: flex-start; /* align left */
    gap: 10px;                   /* space between key and description */
    margin: 2px 0;               /* vertical spacing */
    font-size: 0.9em;
    line-height: 1.4;
}

.shortcut .key {
    width: 120px;                /* fixed width for keys, adjust as needed */
    text-align: left;
}

.shortcut .desc {
    flex: 1;                     /* take remaining space */
}


.app-icon {
    height: 64px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.3s ease;
    cursor: pointer;
    color: #4CAF50; /* Default green */
}

body.dark-mode .app-icon {
    color: #107377; /* Dark mode */
}

/* Example buttons (legacy - may not be used with current layout) */
.example-buttons {
    margin-top: 10px;
}

.example-buttons span {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 600px;
}

.button-grid button {
    padding: 12px;
    font-size: 14px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

.filename-btn {
    background-color: #ccc;
    color: #333;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.filename-btn.selected {
    background-color: #4caf50;
    color: white;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: none;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal h3 {
    margin-top: 0;
    color: #333;
}

.modal-buttons {
    text-align: right;
    margin-top: 20px;
}

.modal-buttons button {
    margin-left: 10px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

/* Modal button types */
.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.modal input[type="text"],
.modal textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 5px;
    box-sizing: border-box;
}

.modal label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

/* Messages area */
#messages {
    height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    background-color: #f8f8f8;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    display: block;
    box-sizing: border-box;
    resize: none;
}

#messages .message {
    margin-bottom: 5px;
    padding: 2px 0;
}

#messages .message.error {
    color: #d32f2f;
}

#messages .message.success {
    color: #388e3c;
}

#messages .message.warning {
    color: #f57c00;
}

#messages .message.info {
    color: #1976d2;
}

/* Scrollbar styling for messages */
#messages::-webkit-scrollbar {
    width: 8px;
}

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

#messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.instructions-content.collapsed {
    max-height: 0;
}

.instructions-content:not(.collapsed) {
    max-height: 1500px;
}

/* ===== DARK MODE STYLES ===== */
/* IMPORTANT: Dark mode only changes colors, NOT spacing/margins/padding */

body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .container {
    background-color: #2a2a2a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
    color: #e0e0e0;
}

body.dark-mode .instructions-section h3,
body.dark-mode .editor-options-section h3,
body.dark-mode .hardware-options-section h3,
body.dark-mode .output-text-section h3 {
    color: #e0e0e0;
}

body.dark-mode .header-bar .build {
    color: #999;
}

body.dark-mode textarea {
    background-color: #1e1e1e;
    color: #d4d4d4;
    border-color: #444;
}

body.dark-mode #output {
    background-color: #1e1e1e;
    color: #d4d4d4;
}

/* Dark mode boxed areas - only change colors, not spacing */
body.dark-mode .options,
body.dark-mode .output-controls,
body.dark-mode .instructions-text {
    background-color: #333;
}

body.dark-mode .editor-help-text {
    color: #aaa;
}

body.dark-mode button {
    background-color: #0d7377;
    border: 1px solid #0a5d61;
}

body.dark-mode button:hover {
    background-color: #14a1a6;
}

body.dark-mode button:disabled {
    background-color: #444;
    border-color: #333;
}

body.dark-mode .filename-btn {
    background-color: #444;
    color: #999;
}

body.dark-mode .filename-btn.selected {
    background-color: #0d7377;
    color: white;
}

body.dark-mode .editor-container {
    border-color: #444;
}

body.dark-mode footer {
    border-top-color: #444;
    color: #999;
}

body.dark-mode footer a {
    color: #14a1a6;
}

/* Dark mode modals */
body.dark-mode .modal-content {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .modal-content h3 {
    color: #e0e0e0;
}

body.dark-mode .modal input[type="text"],
body.dark-mode .modal textarea {
    background-color: #1e1e1e;
    color: #d4d4d4;
    border-color: #444;
}

/* Dark mode modal buttons */
body.dark-mode .btn-primary {
    background-color: #0d7377;
    border: 1px solid #0a5d61;
}

body.dark-mode .btn-primary:hover {
    background-color: #14a1a6;
}

body.dark-mode .btn-secondary {
    background-color: #555;
    border: 1px solid #444;
}

body.dark-mode .btn-secondary:hover {
    background-color: #666;
}

body.dark-mode .btn-danger {
    background-color: #aa3333;
    border: 1px solid #882222;
}

body.dark-mode .btn-danger:hover {
    background-color: #cc4444;
}

/* Dark mode messages */
body.dark-mode #messages {
    background-color: #1e1e1e;
    color: #d4d4d4;
    border-color: #444;
}

body.dark-mode #messages .message.error {
    color: #f48fb1;
}

body.dark-mode #messages .message.success {
    color: #81c784;
}

body.dark-mode #messages .message.warning {
    color: #ffb74d;
}

body.dark-mode #messages .message.info {
    color: #64b5f6;
}

/* Dark mode scrollbar */
body.dark-mode #messages::-webkit-scrollbar-track {
    background: #333;
}

body.dark-mode #messages::-webkit-scrollbar-thumb {
    background: #555;
}

body.dark-mode #messages::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* UPDATED HEADER STYLES - ANIMATED */
.header-bar {
    background: #ffffff;
    border-bottom: 4px solid #4CAF50;
    padding: 25px 40px 20px 40px; /* Changed from 40px 40px 30px 40px */
    margin: 0 0 30px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header-content {
    display: flex;
    align-items: baseline;
    gap: 15px;
}

.header-bar h1 {
    margin: 0;
    font-size: 36px;
    font-weight: 400;
    color: #2c3e50;
    letter-spacing: -1px;
}

.header-bar .build {
    font-size: 14px;
    color: #7f8c8d;
    background: #ecf0f1;
    padding: 6px 12px; /* Changed from 6px 1px */
    border-radius: 25px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.app-icon {
    height: 64px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.3s ease;
    cursor: pointer; /* Add this line */
}

.app-icon:hover {
    opacity: 1;
}

/* Single loading line animation */
.header-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    animation: loadingLineOnce 2s ease-in-out forwards;
}

@keyframes loadingLineOnce {
    0% { 
        width: 0; 
        opacity: 1;
    }
    70% { 
        width: 100%; 
        opacity: 1;
    }
    100% { 
        width: 100%; 
        opacity: 0;
    }
}

/* Dark mode for header bar */
body.dark-mode .header-bar {
    background: #2a2a2a;
    border-bottom-color: #0d7377;
}

body.dark-mode .header-bar h1 {
    color: #e0e0e0;
}

body.dark-mode .header-bar .build {
    background: #333;
    color: #999;
}

body.dark-mode .header-bar::after {
    background: linear-gradient(90deg, #0d7377, #14a1a6);
}

/* Adjust container to accommodate new header */
.container {
    background-color: white;
    padding: 0; /* Remove padding so header can be full width */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Add padding back to the content area */
.container > *:not(.header-bar) {
    margin-left: 30px;
    margin-right: 30px;
}

.container > h2:first-of-type {
    margin-top: 0;
}

/* Hide Mac or Win shortcuts if needed */
.mac-only {
    display: none;
}

.windows-only {
    display: none;
}

/* =========================
   Base Flyout Panel Styles
   ========================= */
.options-panel,
.info-panel,
#instructionsPanel {
    position: fixed;
    top: 0;
    right: -330px; /* Hidden by default */
    width: 300px;  /* Standard width for options/info */
    height: 100vh;
    background: var(--flyout-bg, #f8f9fa);
    border-left: 1px solid var(--flyout-border, #dee2e6);
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

#instructionsPanel {
    width: 600px;
    max-width: 80%;
    right: -630px; /* hidden by default */
}

.options-panel {
    max-width: 80%;
}

/* Open state for all panels */
.options-panel.open,
.info-panel.open,
#instructionsPanel.open {
    right: 0;
}
/* =========================
   Flyout Toggles
   ========================= */
.options-toggle,
.info-toggle,
.instructions-toggle {
    position: fixed;
    right: 0px;
    width: 30px;
    height: 120px;
    background: var(--toggle-bg, #4CAF50);
    /*border: 1px solid var(--toggle-border, #138496);*/
    border-radius: 6px 0 0 6px;
    color: var(--toggle-text, white);
    cursor: pointer;
    z-index: 1001;
    transform: translateY(-50%);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 1px;
    transition: right 0.3s ease, background-color 0.3s ease;
}

/* Toggle vertical positions */
.options-toggle { 
    top: 65%; 
}

.info-toggle { 
    top: calc(65% + 140px); 
}

.instructions-toggle { 
    top: calc(65% + 280px);
}

/* Hover effect */
.options-toggle:hover,
.info-toggle:hover,
.instructions-toggle:hover {
    background: var(--toggle-bg-hover, #45a049);
}

/* =========================
   Panel Content & Headers
   ========================= */
.flyout-header,
#instructionsPanel .flyout-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--flyout-border, #dee2e6);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flyout-header h3,
#instructionsPanel .flyout-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.flyout-content {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form sections with better spacing */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-section label,
.form-section .field-label {
    font-size: 0.95em;
    font-weight: 500;
    color: var(--flyout-text, #333);
    margin-bottom: 4px;
}

.form-section .field-description,
.form-section small {
    font-size: 0.85em;
    color: var(--flyout-text-muted, #666);
    margin-top: 4px;
    line-height: 1.4;
}

/* Buttons, inputs, selects in panels */
.flyout-content button,
.project-folder-button,
.flyout-content select,
.flyout-content input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border-radius: 5px;
    border: 1px solid var(--flyout-border, #dee2e6);
    background: var(--flyout-button-bg, #e9ecef);
    color: var(--flyout-text, #333);
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.flyout-content button:hover,
.project-folder-button:hover {
    background: var(--flyout-button-hover, #dee2e6);
    border-color: var(--flyout-border-hover, #bbb);
}

.flyout-content select,
.flyout-content input[type="text"] {
    background: var(--flyout-input-bg, #ffffff);
    cursor: text;
}

.flyout-content select {
    cursor: pointer;
}

/*#FileModeDiv {
    display: flex;
    flex-direction: column;
    gap: 20px;
}*/

#FileModeDiv .hw-option-label {
    margin-bottom: 14px; /* Creates space after each label */
}

#FileModeDiv .hw-option-label:last-child {
    margin-bottom: 0; /* Remove margin from the last label */
}

/* Checkbox and radio groups */
.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

/* Keyboard shortcuts section */
.keyboard-shortcuts {
    margin-top: 20px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--flyout-border-light, #f0f0f0);
    font-size: 0.85em;
}

.shortcut-key {
    font-family: 'Courier New', monospace;
    background: var(--flyout-key-bg, #f8f9fa);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: bold;
}

/* Project folder and hardware option labels */
.project-folder-label,
.hw-option-label {
    color: #666;
    font-style: italic;
    font-size: 0.88em;
    margin-top: 4px;
    display: block;
}

/* FXCore address input */
.fxcore-address-input {
    padding: 6px 10px;
    border: 1px solid var(--flyout-border, #ccc);
    border-radius: 4px;
    background: var(--flyout-input-bg, #ffffff);
    color: var(--flyout-text, #333);
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Keyboard shortcuts section */
.keyboard-shortcuts-section {
    margin-top: 20px;
}

.platform-shortcuts {
    display: block;
}

.shortcut {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--flyout-border-light, #f0f0f0);
}

.shortcut .key {
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    min-width: 120px;
}

.shortcut .desc {
    font-size: 0.88em;
    color: var(--flyout-text-muted, #666);
}

.shortcut:first-child {
    border-bottom: 2px solid var(--flyout-border, #dee2e6);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.shortcut:first-child .key {
    font-family: inherit;
    font-size: 0.9em;
    font-weight: 600;
}

/* Section spacing */
.flyout-section {
    margin-bottom: 25px;
}

.flyout-section h4 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--flyout-text, #333);
    border-bottom: 1px solid var(--flyout-border-light, #f0f0f0);
    padding-bottom: 8px;
}

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

.options > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* =========================
   Dark Mode
   ========================= */
body.dark-mode .options-panel,
body.dark-mode .info-panel,
body.dark-mode #instructionsPanel {
    --flyout-bg: #2a2a2a;
    --flyout-text: #e0e0e0;
    --flyout-text-muted: #999;
    --flyout-border: #444;
    --flyout-border-light: #333;
    --flyout-border-hover: #666;
    --flyout-button-bg: #404040;
    --flyout-button-hover: #505050;
    --flyout-input-bg: #1e1e1e;
    --flyout-key-bg: #333;
}

body.dark-mode .options-toggle,
body.dark-mode .info-toggle,
body.dark-mode .instructions-toggle {
    --toggle-bg: #0d7377;
    --toggle-bg-hover: #14a1a6;
    --toggle-border: #0a5d61;
    --toggle-text: #ffffff;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .form-section label,
body.dark-mode .form-section .field-label {
    color: var(--flyout-text, #e0e0e0);
}

body.dark-mode .shortcut-item {
    border-bottom-color: var(--flyout-border-light, #333);
}

body.dark-mode .project-folder-label,
body.dark-mode .hw-option-label {
    color: #999;
}

body.dark-mode .fxcore-address-input {
    border-color: var(--flyout-border, #444);
    background: var(--flyout-input-bg, #1e1e1e);
    color: var(--flyout-text, #e0e0e0);
}

body.dark-mode .shortcut {
    border-bottom-color: var(--flyout-border-light, #333);
}

body.dark-mode .shortcut:first-child {
    border-bottom-color: var(--flyout-border, #444);
}

body.dark-mode .shortcut .desc {
    color: var(--flyout-text-muted, #999);
}

body.dark-mode .flyout-section h4 {
    color: var(--flyout-text, #e0e0e0);
    border-bottom-color: var(--flyout-border-light, #333);
}

/* =========================
   FXCore Opcodes Flyout
   ========================= */
.opcodes-container {
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    padding: 20px;
}

.version-info {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 20px;
    font-size: 0.9em;
}

/* Sticky nav with solid background */
.opcode-nav-links {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background-color: #fafafa;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid #e1e8ed;
}

/* Nav links styled like category badges */
.opcode-nav-link {
    color: #fff;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.opcode-nav-link:hover { 
    opacity: 0.85;
    transform: translateY(-1px);
}

.opcode-nav-link.math-operations { background-color: #e74c3c; }
.opcode-nav-link.copy-operations { background-color: #9b59b6; }
.opcode-nav-link.load-store-operations { background-color: #3498db; }
.opcode-nav-link.logic-operations { background-color: #27ae60; }
.opcode-nav-link.jump-instructions { background-color: #f39c12; }
.opcode-nav-link.extended-operations { background-color: #e91e63; }

.opcode-nav-link.panel-open,
.opcode-nav-link.active {
    background: #007bff;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

/* =========================
   Opcode Cards
   ========================= */
.opcode-card {
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 15px;
    background-color: #fafafa;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.opcode-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.opcode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.opcode-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    margin: 0;
}

.opcode-syntax {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 10px 12px;
    border-radius: 5px;
    margin-bottom: 12px;
    font-weight: bold;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Category Badges */
.opcode-category {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    white-space: nowrap;
    color: white;
    font-weight: 500;
}

.opcode-category.math-operations { background-color: #e74c3c; }
.opcode-category.copy-operations { background-color: #9b59b6; }
.opcode-category.load-store-operations { background-color: #3498db; }
.opcode-category.logic-operations { background-color: #27ae60; }
.opcode-category.jump-instructions { background-color: #f39c12; }
.opcode-category.extended-operations { background-color: #e91e63; }

.opcode-description {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ecf0f1;
    line-height: 1.5;
}

.opcode-section-header {
    font-size: 1.4em;
    color: #2c3e50;
    margin: 25px 0 18px 0;
    padding: 10px 0;
    border-bottom: 2px solid #3498db;
    scroll-margin-top: 100px;
    font-weight: 600;
}

.opcode-section-header:first-of-type {
    margin-top: 0;
}

/* Dark mode support for opcodes */
body.dark-mode .opcodes-container { 
    color: #e0e0e0; 
}

body.dark-mode .opcode-nav-links { 
    background-color: #2a2a2a;
    border-bottom-color: #444;
}

body.dark-mode .opcode-card { 
    background-color: #2a2a2a; 
    border-color: #444; 
}

body.dark-mode .opcode-card:hover { 
    border-color: #0d7377;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .opcode-name,
body.dark-mode .opcode-section-header { 
    color: #e0e0e0; 
}

body.dark-mode .opcode-syntax { 
    background-color: #1a1a1a;
    color: #e0e0e0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

body.dark-mode .opcode-description { 
    color: #b0b0b0; 
    border-top-color: #444; 
}