:root {
    --bg-color: #1e1e1e;
    --text-color: #d4d4d4;
    --editor-bg: #252526;
    --accent-color: #007acc;
    --header-height: 60px;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    height: var(--header-height);
    background-color: #333;
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: center;
}

h1 {
    font-size: 1.2rem;
    margin: 0;
}

button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 4px;
    z-index: 100;
}

button:hover {
    background-color: #005f9e;
}

main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.editor-container {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.output-container {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

#run-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.output-container {
    border-left: 1px solid #444;
    background-color: #1e1e1e;
}

h3 {
    margin-top: 0;
}

#output {
    flex: 1;
    background-color: #000;
    padding: 10px;
    overflow: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    white-space: pre-wrap;
    color: #4ec9b0;
}

/* Syntax Highlighting Editor */
.code-wrapper {
    position: relative;
    flex: 1;
    background-color: var(--editor-bg);
    overflow: hidden;
    border: 1px solid #444;
}

.backdrop,
textarea {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 10px;
    border: 0;
    box-sizing: border-box;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-y: scroll;
    /* Force scrollbar to ensure consistent width */
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* Modern standard */
    font-variant-ligatures: none;
    /* Prevent ligature size diffs */
    letter-spacing: 0;
}

.backdrop {
    z-index: 1;
    pointer-events: none;
    color: var(--text-color);
}



textarea {
    z-index: 2;
    background: transparent;
    color: transparent;
    caret-color: white;
    resize: none;
    outline: none;
}

/* Highlighting Tokens */
mark {
    border-radius: 0;
    color: transparent;
    background-color: transparent;
}

.token-keyword {
    color: #569cd6;
}

.token-string {
    color: #ce9178;
}

.token-number {
    color: #b5cea8;
}

.token-comment {
    color: #6a9955;
}

.token-operator {
    color: #d4d4d4;
}

.token-type {
    color: #4ec9b0;
}

#docs-section {
    height: 300px;
    overflow-y: auto;
    background-color: #2d2d2d;
    padding: 20px;
    border-top: 1px solid #444;
}

#docs-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Markdown Styles */
#docs-content h1,
#docs-content h2,
#docs-content h3 {
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

#docs-content code {
    background-color: #444;
    padding: 2px 5px;
    border-radius: 3px;
}

#docs-content pre {
    background-color: #1e1e1e;
    padding: 10px;
    overflow-x: auto;
}

#docs-content a {
    color: var(--accent-color);
    text-decoration: none;
}

#docs-content a:hover {
    text-decoration: underline;
}

.emoji-particle {
    position: fixed;
    font-size: 36px;
    pointer-events: none;
    z-index: 99;
    animation: emoji-float-with-gravity 3.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: transform, opacity;
}

@keyframes emoji-float-with-gravity {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--vx), calc(var(--vy-initial) + var(--gravity))) rotate(var(--rotation));
        opacity: 0;
    }
}