:root {
    --sidebar-bg: #1e1e1e;
    --sidebar-text: #cccccc;
    --sidebar-hover: #2d2d2d;
    --sidebar-active: #37373d;
    --main-bg: #1e1e1e;
    --editor-bg: #ffffff;
    --border-color: #333333;
    --accent-color: #007acc;
    --text-color: #d4d4d4;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--main-bg);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    display: block;
}

.sidebar-menu {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.menu-item.active {
    background-color: var(--sidebar-active);
    color: #ffffff;
    border-right: 3px solid var(--accent-color);
}

.menu-item i {
    margin-right: 0.75rem;
    width: 16px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: #666;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.editor-wrapper {
    display: flex;
    flex: 1;
    height: 100%;
}

.pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 200px;
    /* Prevent collapsing too small */
}

.resizer {
    width: 12px;
    background-color: #252526;
    cursor: col-resize;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
    z-index: 10;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
}

.resizer-handle {
    width: 4px;
    height: 24px;
    background: radial-gradient(circle, #666 1.5px, transparent 2px);
    background-size: 4px 6px;
    background-repeat: repeat-y;
    opacity: 0.6;
}

.resizer:hover .resizer-handle,
.resizer.active .resizer-handle {
    opacity: 1;
    background: radial-gradient(circle, #fff 1.5px, transparent 2px);
    background-size: 4px 6px;
}

.resizer:hover,
.resizer.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.pane:last-child {
    border-right: none;
}

.pane-header {
    background-color: #252526;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: #cccccc;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pane-content {
    flex: 1;
    position: relative;
    background-color: var(--editor-bg);
    overflow: hidden;
    /* Ensure CodeMirror stays within bounds */
    display: flex;
    flex-direction: column;
}

.CodeMirror {
    flex: 1;
    height: 100%;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

textarea#html-input {
    width: 100%;
    height: 100%;
    border: none;
    padding: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    resize: none;
    outline: none;
    background-color: #1e1e1e;
    color: #d4d4d4;
    line-height: 1.5;
    flex: 1;
}

iframe#html-preview {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
    flex: 1;
}

/* Utility Classes */
.hidden-mobile {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding: 0.5rem;
    }

    .menu-item {
        padding: 0.5rem 1rem;
        white-space: nowrap;
    }

    .editor-wrapper {
        flex-direction: column;
    }

    .pane {
        height: 50%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .resizer {
        display: none;
    }
}