* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}



header {
    text-align: center;
    font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    margin-bottom: 30px;
    padding: 20px;
    background: #19438c;
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);


}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.left-panel, .right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-section, .console-section, .execution-controls, 
.registers-section, .memory-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #19438c;
    border-bottom: 2px solid #19438c;
    padding-bottom: 5px;
}

#codeEditor {
    width: 100%;
    height: 300px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    background-color: #f8f8f8;
}

#codeEditor:focus {
    outline: none;
    border-color: #17a2b8;
}

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

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #17a2b8;
    color: white;
}

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

.btn-success {
    background-color: #318613;
    color: white;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-warning {
    background-color: #FFB74C;
    color: #333;
}

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

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

.console {
    height: 180px;
    background-color: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    padding: 10px;
    border-radius: 5px;
    overflow-y: auto;
    white-space: pre-wrap;
}

#consoleInput {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    border: 2px solid #667eea;
    border-radius: 5px;
    font-family: monospace;
}

.control-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.pc-display {
    margin-bottom: 1px;
    font-size: 18px;
}

.pc-display span {
    font-weight: bold;
    color: #17a2b8;
    font-family: monospace;
    font-size: 18px;
}

.speed-control {
    display:flex;
    align-items: center;
    gap: 10px;
}

.speed-control input[type="range"] {
    flex: 1;
}

.registers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.register {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.register.changed {
    background-color: #fff3cd;
    border-color: #ffc107;
    animation: highlight 0.5s ease;
}

.register.r0 {
    background-color: #e7e7e7;
    opacity: 0.7;
}

.register.active{
    outline: 2px solid #C2B280;
    box-shadow: 0 0 10px #C2B280;
    transition: all 0.2s ease;
}

.register-name {
    font-weight: bold;
    color: #495057;
    font-size: 14px;
}

.register-value {
    font-family: monospace;
    font-size: 16px;
    color: #19438c;
    margin-top: 5px;
}

.memory-controls {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.memory-controls input[type="number"] {
    width: 60px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.memory-grid {
    max-height: 150px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 13px;
}

.memory-row {
    display: grid;
    grid-template-columns: 60px 1fr;
    padding: 4px;
    border-bottom: 1px solid #eee;
}

.memory-row:hover {
    background-color: #f8f9fa;
}

.memory-row.changed {
    background-color: #d4edda;
    animation: highlight 0.5s ease;
}

.memory-row.current-instruction {
    background-color: #cfe2ff;
    border-left: 3px solid #19438c;
}

.memory-address {
    color: #6c757d;
    font-weight: bold;
}

.memory-value {
    color: #19438c;
    padding-left: 10px;
}

.memory-bits {
    font-family: monospace;
    color: #888;
    padding-left: 1rem;
}
.memory-instruction {
    flex: 1;
    white-space: nowrap;
}
.memory-row {
    display: flex;
    gap: 0.5rem;
    padding: 2px 0;
}
.memory-address {
    width: 3ch;
    font-weight: bold;
}

footer {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 14px;
}

@keyframes highlight {
    0% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .registers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.error {
    color: #dc3545;
    font-weight: bold;
}

.success {
    color: #28a745;
}

.info {
    color: #17a2b8;
}

.current-line {
    background-color: #fffacd;
    border-left: 3px solid #ffc107;
}