:root {
    --primary-color: #771eff;
    --success-color: #771eff;
    --error-color: #f44336;
    --bg-color: #08051b;
    --text-color: #fff;
    --border-color: #ddd;
    --code-bg: #f8f9fa;
}

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

body {
    font-family: "Tajawal", Arial, sans-serif;
    margin: 0 auto;
    padding: 20px;
    direction: rtl;
    max-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    background-size: cover;
    overflow-x: hidden;
    background-image: url("https://aliflang.org/Source/Assets/Background.webp");
}

a {
    color: gray;
    text-decoration: none;
}

.container {
    padding-top: 20px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.testAlif {
    display: flex;
    justify-content: space-between;
    width: 100%;
    min-height: 70vh;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

.editorContainer {
    margin-bottom: 2rem;
    margin: 10px;
    width: 100%;
}

.editorHeader {
    display: flex;
    height: 8%;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

#editor {
    height: 90%;
    max-height: 60vh;
}

.CodeMirror-vscrollbar {
    display: none;
    overflow-y: hidden;
}

h2 {
    font-size: 1.2rem;
    color: #444;
}

#code {
    width: 100%;
    height: 90%;
    font-family: "Cascadia Code", "Courier New", monospace;
    resize: vertical;
    line-height: 1.5;
    color: var(--text-color);
    background-color: transparent;
    transition: border-color 0.3s;
    position: relative;
    display: flex;
    padding: 10px;
    font-size: 16px;
    margin: 10px 0;
    border: 2px solid #182d5555;
    border-radius: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 2px 2px 1px #2079ff;
}

#code:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.runButton {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.1s;
}

.runButton:hover {
    background-color: #5b3398;
}

.runButton:active {
    transform: translateY(1px);
}

.runButton .icon {
    font-size: 14px;
}

#root {
    max-height: 250px;
    overflow: scroll;
    border-radius: 16px;
}

#output {
    margin-top: 1rem;
    border-radius: 6px;
    min-height: 100px;
    padding: 0;
    overflow: auto;
    transition: all 0.3s;
    max-height: 60vh;
}

.outputContainer {
    position: relative;
    overflow: scroll;
    max-height: 100%;
    padding: 10px;
    font-size: 16px;
    margin: 10px 0;
    border: 2px solid #182d5555;
    border-radius: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 2px 2px 1px #2079ff;
    margin: 10px;
    width: 100%;
}

.output-content {
    font-family: "Cascadia Code", "Courier New", monospace;
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
}

.output-code {
    width: 100%;
}

.placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 1.5rem;
    margin: 0;
}

.success {
    border-left: 4px solid var(--success-color);
}

.error {
    border-left: 4px solid var(--error-color);
    color: var(--error-color);
}

footer {
    margin-top: 2rem;
    text-align: center;
    color: #777;
    font-size: 0.9rem;
}

/* CodeMirror styles */
.cm-s-monokai.CodeMirror {
    border: none;
    direction: rtl;
    font-family: "Tajawal", "Droid Arabic Kufi", "Droid Sans", sans-serif;
    font-size: 16px;
    height: 100%;
    color: var(--text-color);
    background-color: transparent;
    transition: border-color 0.3s;
    padding: 10px;
    font-size: 16px;
    margin: 10px 0;
    border: 2px solid #182d5555;
    border-radius: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 2px 2px 1px #2079ff;
}

.CodeMirror-gutters {
    background: #272822;
    border-right: 1px solid #555;
}

.CodeMirror-linenumber {
    color: #acb6bf8c;
    padding-right: 5px;
    border-right: 1px solid #acb6bf8c;
}

/* Custom Alif language specific */
.cm-s-monokai span.cm-keyword,
.cm-s-monokai .cm-alif-keyword {
    color: #ff8f40;
}
.cm-s-monokai .cm-alif-builtin {
    color: #66d9ef;
}
.cm-s-monokai .cm-alif-boolean {
    color: #d2a6ff;
}
.cm-s-monokai .cm-alif-function {
    color: #ffb454;
}
.cm-s-monokai span.cm-string {
    color: #aad94c;
}
.cm-s-monokai span.cm-comment {
    font-style: italic;
    color: #acb6bf8c;
}

.cm-s-monokai span.cm-operator {
    color: #ff8f40;
}

.cm-s-monokai .CodeMirror-gutters,
.cm-s-monokai.CodeMirror,
.CodeMirror {
    font-family: "Tajawal", "Droid Arabic Kufi", "Droid Sans", sans-serif;
    font-size: 16px;
    height: 100%;
    text-align: right;
    direction: rtl;
    background: transparent;
}

.CodeMirror-scroll {
    min-height: 300px;
    max-height: 60vh;
}

.CodeMirror-lines {
    padding: 10px 0;
}

/* Custom hint styling */
.CodeMirror-hints {
    font-family: "Cairo", sans-serif;
    border: 1px solid #4a4a4a;
    background: #2a2a2a;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    max-height: 20em;
    overflow-y: auto;
    z-index: 10;
}

.CodeMirror-hint {
    padding: 8px 12px;
    color: #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.CodeMirror-hint:hover {
    background: #3a3a3a;
}

.CodeMirror-hint-active {
    background: #3a3a3a;
}

.hint-name {
    font-weight: bold;
    margin-left: 8px;
}

.hint-doc {
    color: #888;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.hint-type {
    color: #4fc3f7;
    font-size: 0.8em;
    background: rgba(79, 195, 247, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

@media (max-width: 768px) {
    .testAlif {
        flex-direction: column;
    }
    .container {
        padding: 1rem;
    }
    #editor {
        height: 90%;
        max-height: none;
    }

    #code {
        height: 200px;
    }
}
