:root {
    --bg-dark: #121212;
    --bg-gradient: #121212;
    --glass-bg: #121212;
    --glass-border: #121212;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #00d2ff;
    --accent-glow: 0 0 10px rgba(0, 210, 255, 0.5);
    --html-color: #ff6b6b;
    --css-color: #48dbfb;
    --js-color: #feca57;
    --font-heading: 'Inter', sans-serif;
    --font-code: 'Fira Code', monospace;
}

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

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    font-family: var(--font-heading);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #121212;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.logo span {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #3a86ff, #02939c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 26px;
    font-weight: bold;
    letter-spacing: 1px;
    display: inline-block;
}

.logo i {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #3a86ff, #02939c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 26px;
    font-weight: bold;
    letter-spacing: 1px;
    display: inline-block;
}

p {
    margin-top: 8px
}

.actions button {
    background: var(--accent-color);
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    color: #000;
    font-family: var(--font-heading);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.actions button:hover {
    box-shadow: 0 0 15px var(--accent-color);
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    /* Prevent body scroll */
}

/* Editors */
.editors-container {
    width: 40%;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--glass-border);
}

.editor-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* Important for flex items to shrink */
    border-bottom: 1px solid var(--glass-border);
}

.editor-pane:last-child {
    border-bottom: none;
}

.pane-header {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.html-header i {
    color: var(--html-color);
}

.css-header i {
    color: var(--css-color);
}

.js-header i {
    color: var(--js-color);
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    resize: none;
    padding: 1rem;
    color: #e0e0e0;
    font-family: var(--font-code);
    font-size: 0.9rem;
    line-height: 1.5;
    outline: none;
    width: 100%;
}

textarea::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Preview */
.preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    /* Iframe needs white bg by default */
    position: relative;
    overflow: hidden;
}

.preview-header {
    background: #f0f0f0;
    color: #333;
    border-bottom: 1px solid #ddd;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsiveness */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        overflow-y: auto;
    }

    .editors-container {
        width: 100%;
        height: 50vh;
        order: 2;
    }

    .preview-container {
        height: 50vh;
        order: 1;
        border-bottom: 1px solid var(--glass-border);
    }

    .app-header {
        padding: 1rem;
    }
}