body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #1e1e1e;
    color: #d4d4d4;
    margin: 0;
    padding: 10px;
    height: 100vh;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}

/* Light Mode Styles */
body.light-mode {
    background-color: #f0f0f0;
    color: #333;
}

body.light-mode .navbar {
    background-color: #ffffff;
    border-color: #ccc;
}

body.light-mode .nav-left h1 {
    color: #333;
}

body.light-mode #font-size {
    background-color: #fff;
    color: #333;
    border-color: #ccc;
}

body.light-mode .nav-btn {
    background-color: #e0e0e0;
    color: #333;
}

body.light-mode .output-container {
    background-color: #ffffff;
    border-color: #ccc;
}

body.light-mode h3 {
    color: #2e7d32;
    border-bottom-color: #eee;
}

body.light-mode pre {
    color: #555555;
}

body.light-mode .terminal-input {
    color: #000;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 1400px;
    margin: auto;
}

/* Navbar Styles */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background-color: #2d2d2d;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid #3c3c3c;
}

.nav-left h1 {
    color: #ffffff;
    margin: 0;
    font-size: 1.2rem;
    white-space: nowrap;
}

.nav-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

#font-size {
    background-color: #1e1e1e;
    color: #fff;
    border: 1px solid #555;
    padding: 5px;
    border-radius: 4px;
    outline: none;
    font-size: 13px;
}

.nav-btn {
    background-color: #3e3e42;
    color: #fff;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    flex: none;
    width: auto;
    white-space: nowrap;
}

.nav-btn:hover {
    background-color: #4e4e52;
}

/* Tablet and Desktop optimizations */
@media (min-width: 600px) {
    .nav-left h1 {
        font-size: 1.4rem;
    }

    .nav-btn {
        padding: 8px 15px;
        font-size: 14px;
    }

    #font-size {
        font-size: 14px;
    }
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    min-height: 0;
}

.editor-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.CodeMirror {
    flex: 1;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 16px;
    border: 1px solid #3c3c3c;
    border-radius: 4px;
    height: auto;
}

.controls-output-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

.button-group {
    display: flex;
    gap: 10px;
}

button {
    flex: 1;
    background-color: #0e639c;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #1177bb;
}

#clear-btn {
    background-color: #3e3e42;
}

#clear-btn:hover {
    background-color: #4e4e52;
}

.output-container {
    background-color: #000000;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #3c3c3c;
    flex: 1;
    overflow-y: auto;
}

h3 {
    margin-top: 0;
    font-size: 1rem;
    color: #ce9178;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    color: #bbbbbb;
}

.terminal-input {
    background: transparent;
    border: none;
    color: white;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    outline: none;
    width: auto;
    min-width: 50px;
    padding: 0;
    margin: 0;
}

/* Error highlighting style */
.error-line {
    background: rgba(255, 0, 0, 0.2) !important;
}

/* Responsive Layout for Tablets/Laptops/Desktops */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }

    .main-content {
        flex-direction: row;
        align-items: stretch;
    }

    .editor-section {
        flex: 2;
    }

    .controls-output-section {
        flex: 1;
        min-width: 350px;
    }
}