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

:root {
    --bg-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
    --button-bg: #007bff;
    --button-text: white;
    --header-bg: #f8f9fa;
    --monetization-bg: #ffc107;
    --monetization-text: #212529;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --border-color: #444;
        --button-bg: #0056b3;
        --header-bg: #2d2d2d;
        --monetization-bg: #e67e22;
        --monetization-text: #ffffff;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

.monetization-banner {
    background: var(--monetization-bg);
    color: var(--monetization-text);
    padding: 8px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    z-index: 1000;
}

.hidden {
    display: none !important;
}

.main-container {
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.toolbar {
    background: var(--header-bg);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.toolbar span {
    flex: 1;
}

.toolbar button {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--button-bg);
    color: var(--button-text);
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.toolbar button:hover {
    opacity: 0.9;
}

select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
}

#editor {
    flex: 1;
    width: 100%;
    overflow: auto;
}

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-content {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
}

.auth-content h2 {
    margin-bottom: 1rem;
    text-align: center;
}

.auth-content input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
}

.auth-content button {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: none;
    border-radius: 4px;
    background: var(--button-bg);
    color: var(--button-text);
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.auth-content button:hover {
    opacity: 0.9;
}

.remote-cursor {
    position: absolute;
    width: 2px;
    height: 1.2em;
    background: rgba(74, 144, 226, 0.7);
    border-radius: 1px;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.remote-cursor.color-0 { background: rgba(74, 144, 226, 0.7); }
.remote-cursor.color-1 { background: rgba(156, 39, 176, 0.7); }
.remote-cursor.color-2 { background: rgba(76, 175, 80, 0.7); }
.remote-cursor.color-3 { background: rgba(255, 152, 0, 0.7); }
.remote-cursor.color-4 { background: rgba(244, 67, 54, 0.7); }
.remote-cursor.color-5 { background: rgba(0, 188, 212, 0.7); }

.remote-cursor::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 8px;
    height: 8px;
    background: inherit;
    border-radius: 50%;
}

.remote-cursor.fade-out {
    opacity: 0;
}