body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    background: #1e1e2f;
    color: #d4d4d4;
    overflow: hidden;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
}

.container {
    flex: 1;
    padding: 20px 40px 40px 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #1e1e2f;
    max-width: 1600px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #cba6f7;
    font-size: 1.8em;
    margin-bottom: 0;
}

.credit {
    font-size: 0.4em;
    color: #94e2d5;
    font-weight: normal;
    vertical-align: bottom;
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#badchars, #arch-mode {
    padding: 8px;
    border: none;
    border-radius: 5px;
    background: #2a2a3c;
    color: #d4d4d4;
    font-size: 0.9em;
    transition: background 0.3s;
}

#badchars {
    flex: 1;
    min-width: 200px;
}

#arch-mode {
    width: 150px;
}

#badchars:focus, #arch-mode:focus {
    outline: none;
    background: #3a3a4c;
}

.panels {
    display: flex;
    gap: 20px;
    flex: 1;
    height: calc(100vh - 140px);
    min-height: 0;
    width: 100%;
    margin-top: 10px;
}

.editor-wrapper {
    position: relative;
    flex: 0.8;
    height: 100%;
}

#asm-input, .output-panel {
    flex: 1;
    min-width: 400px;
    height: auto;
    padding: 15px;
    border-radius: 5px;
    background: #2a2a3c;
    color: #d4d4d4;
    font-size: 0.9em;
    border: none;
    resize: none;
    transition: box-shadow 0.3s;
}

#asm-input {
    flex: 2;
    min-width: 300px;
    display: none;
}

#editor-container {
    flex: 2;
    min-width: 300px;
    height: 100%;
}

.CodeMirror {
    height: 100% !important;
    border-radius: 5px;
    background: #2a2a3c !important;
    color: #d4d4d4 !important;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9em;
}

.CodeMirror-gutters {
    background: #1e1e2f !important;
    border-right: 1px solid #3a3a4c !important;
    border-radius: 5px 0 0 5px;
}

.CodeMirror-linenumber {
    color: #6c7086 !important;
}

.CodeMirror-focused {
    box-shadow: 0 0 5px #cba6f7;
}

.output-panel {
    flex: 1.2;
    height: 100%;
    background: #272822;
    padding: 10px;
    font-family: 'Roboto Mono', monospace;
    color: #f8f8f2;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Custom Scrollbar - Updated */
#asm-input::-webkit-scrollbar,
.output-panel::-webkit-scrollbar {
    width: 10px;
    background: transparent;
}

#asm-input::-webkit-scrollbar-track,
.output-panel::-webkit-scrollbar-track {
    background: rgba(30, 30, 47, 0.3);
    border-radius: 10px;
    margin: 5px;
}

#asm-input::-webkit-scrollbar-thumb,
.output-panel::-webkit-scrollbar-thumb {
    background: #cba6f7;
    border-radius: 10px;
    border: 3px solid rgba(42, 42, 60, 0.9);
}

#asm-input::-webkit-scrollbar-thumb:hover,
.output-panel::-webkit-scrollbar-thumb:hover {
    background: #dbb6ff;
}

/* For Firefox */
#asm-input,
.output-panel {
    scrollbar-width: thin;
    scrollbar-color: #cba6f7 rgba(30, 30, 47, 0.3);
}

#asm-input:focus {
    outline: none;
    box-shadow: 0 0 5px #cba6f7;
}

.output-line {
    display: grid;
    grid-template-columns: minmax(300px, auto) 1fr;
    align-items: center;
    padding: 5px;
    gap: 20px;
    background: transparent;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.output-line:hover {
    background: rgba(58, 58, 76, 0.5);
}

.opcodes {
    color: #94e2d5;
    min-width: 250px;
    padding-right: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asm {
    color: #f5e0dc;
    text-align: left;
    padding-left: 10px;
}

.highlight {
    color: #f38ba8;
}

.error {
    color: #f38ba8;
    font-style: italic;
}

.label {
    color: #89b4fa;
    font-style: italic;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: #3f3f3f;
    border: none;
    border-radius: 4px;
    padding: 8px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s;
}

.copy-btn:hover {
    background: #4f4f4f;
}

.copy-btn i {
    transition: transform 0.3s;
}

.copy-btn.copied i {
    transform: scale(1.2);
}

.copy-btn.copied .fa-copy {
    display: none;
}

.copy-btn:not(.copied) .fa-check {
    display: none;
}

.badchars-wrapper {
    position: relative;
    flex: 1;
}

#badchars {
    width: 100%;
    box-sizing: border-box;
}

.count-badge {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(243, 139, 168, 0.2);
    color: #f38ba8;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.count-badge.visible {
    opacity: 1;
}

textarea {
    width: 100%;
    min-height: 150px;
    margin: 10px 0;
    padding: 10px;
}

button {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

#result {
    margin-top: 20px;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .panels {
        flex-direction: column;
    }
    .editor-wrapper, .output-panel {
        height: 50%;
    }
}