:root {
    --dark-bg: #f8f9fa;
    --darker-bg: #ffffff;
    --editor-bg: #ffffff;
    --text-color: #222;
    --border-color: #e0e0e0;
    --header-bg: #f5f6f8;
    --sidebar-bg: #f3f3f3;
}

:root[data-theme="dark"] {
    --dark-bg: #1e1e1e;
    --darker-bg: #252526;
    --editor-bg: #1e1e1e;
    --text-color: #d4d4d4;
    --border-color: #3c3c3c;
    --header-bg: #2d2d30;
    --sidebar-bg: #3c3c3c;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark-bg);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    color: var(--text-color);
}

.w-100 {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.w-100.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: var(--dark-bg);
}

.fullscreen .header {
    position: sticky;
    top: 0;
    z-index: 10000;
}

/* Header */
.header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 25px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    justify-items: start;
    gap: 16px;
}

.logo-section { display: flex; align-items: center; gap: 15px; }

.header-ad { display: flex; justify-content: center; align-items: center; min-height: 60px; justify-self: center; }

.pro-button { justify-self: end; }

.header-ad .ad-slot {
    width: 728px;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f0f2f5;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: #888;
    font-size: 14px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
}

.logo-icon .code-symbol {
    font-size: 16px;
    position: absolute;
    top: 2px;
    right: 2px;
    opacity: 0.8;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.5px;
    margin: 0;
    font-family: 'Nunito', sans-serif;
}

.logo-title .highlight {
    color: var(--accent-color);
}

.logo-title .normal {
    color: #495057;
}

:root[data-theme="dark"] .logo-title .normal {
    color: #ffffff;
}

.logo-subtitle {
    font-size: 13px;
    color: #888;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.2px;
    opacity: 0.8;
}

.pro-button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
}

.pro-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow: hidden;
    background: var(--dark-bg);
}

/* Editor Section */
.editor-section {
    height: 100%;
    display: flex;
    flex-direction: row;
    background: var(--darker-bg);
}

.sidebar {
    width: 60px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    flex-shrink: 0;
}

.sidebar-horizontal {
    display: none;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
    justify-content: center;
    gap: 15px;
}

.sidebar-horizontal .lang-icon {
    width: 35px;
    height: 35px;
    margin: 0;
}

.lang-icon {
    width: 40px;
    height: 40px;
    margin: 5px 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
    color: #888;
    font-size: 20px;
    background: transparent;
}

.lang-icon:hover {
    background: #e0e0e0;
}

.lang-icon.active {
    background: var(--accent-color);
    color: white;
}

.editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.editor-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-name {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
}

.editor-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.control-btn:hover {
    background: #e0e0e0;
}

.clear-btn {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.clear-btn:hover {
    background: #e0e0e0;
}

/* Dark mode button overrides */
:root[data-theme="dark"] .control-btn {
    background: #3c3c3c;
    border-color: #5a5a5a;
    color: #d4d4d4;
}

:root[data-theme="dark"] .control-btn:hover {
    background: #4a4a4a;
}

:root[data-theme="dark"] .clear-btn {
    background: #3c3c3c;
    border-color: #5a5a5a;
    color: #d4d4d4;
}

:root[data-theme="dark"] .clear-btn:hover {
    background: #4a4a4a;
}

.run-btn {
    background: var(--accent-color);
    border: 1px solid var(--accent-color);
    color: white;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.run-btn:hover {
    background: transparent;
    color: var(--accent-color);
    box-shadow: none;
}

.run-btn:hover i {
    color: var(--accent-color);
}

/* Editor */
#editor {
    flex: 1;
    background: var(--editor-bg);
}

/* Output Section */
.output-section {
    height: 100%;
    background: var(--darker-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.output-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.output-title {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
}

.clear-btn {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.clear-btn:hover {
    background: #e0e0e0;
}

#output {
    flex: 1;
    padding: 10px;
    background: var(--darker-bg);
    color: var(--text-color);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-y: auto;
    white-space: pre-wrap;
}

.ace-chrome .ace_gutter{
    background: #fff !important;
}

#editor{
    line-height: 22px !important;
}

/* Dark mode Ace editor overrides */
:root[data-theme="dark"] .ace-chrome .ace_gutter {
    background: #1e1e1e !important;
    color: #d4d4d4 !important;
}

:root[data-theme="dark"] .ace-chrome .ace_content {
    background: #1e1e1e !important;
}

:root[data-theme="dark"] .ace-chrome .ace_cursor {
    color: #d4d4d4 !important;
}

.side-ad-container {
    height: 100%;
    background: var(--darker-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
   /* align-items: center;
    justify-content: center;*/
    padding: 10px;
}

.side-ad {
    width: 160px;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: #888;
    font-size: 14px;
    text-align: center;
}

:root[data-theme="dark"] .side-ad {
    background: #2b2b2b;
    color: #bbb;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .sidebar {
        display: none;
    }
    
    .sidebar-horizontal {
        display: flex;
    }
    
    .editor-section {
        height: 50vh;
        flex-direction: column;
    }
    
    .output-section {
        height: 50vh;
        border-left: none;
    }

    .output-header {
        border-top: 1px solid var(--border-color);
    }
    
    .w-100 {
        height: auto;
        overflow: auto;
    }
    
    .main-content {
        overflow: auto;
    }
}


