:root {
    /* Dark Theme (Default) */
    --glass-bg: rgba(16, 18, 27, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.3);
    --text-color: rgba(255, 255, 255, 0.85);
    --accent: #6c5ce7;
    --accent-hover: #8075e5;
    --bg-gradient-1: #2a0845;
    --bg-gradient-2: #121212;
}

/* Light Theme */
.light-theme {
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: rgba(0, 0, 0, 0.1);
    --text-color: rgba(0, 0, 0, 0.8);
    --accent: #6c5ce7;
    --accent-hover: #8075e5;
    --bg-gradient-1: #c9d6ff;
    --bg-gradient-2: #e2e2e2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2));
    color: var(--text-color);
    min-height: 100vh;
    overflow: hidden;
}

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

.menubar {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 8px 16px;
    box-shadow: 0 4px 15px var(--glass-shadow);
    display: flex;
    align-items: center;
    z-index: 10;
}

.menu-button {
    background: transparent;
    color: var(--text-color);
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    position: relative;
    border-radius: 4px;
    transition: background 0.2s;
}

.menu-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: 0 10px 20px var(--glass-shadow);
    display: none;
    z-index: 100;
}

.menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    cursor: pointer;
    color: var(--text-color);
    background: transparent;
    border: none;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item span.shortcut {
    opacity: 0.6;
    font-size: 12px;
    margin-left: 16px;
}

.separator {
    height: 1px;
    background: var(--glass-border);
    margin: 4px 8px;
}

.editor-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    padding: 16px;
}

.editor {
    width: 100%;
    height: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px var(--glass-shadow);
    padding: 16px;
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.5;
    resize: none;
    outline: none;
}

.status-bar {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.dialog {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 15px 35px var(--glass-shadow);
    width: 400px;
    max-width: 90%;
    padding: 20px;
}

.dialog h2 {
    margin-bottom: 16px;
    font-size: 18px;
}

.dialog-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-color);
    margin-bottom: 20px;
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.dialog-button {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.primary-button {
    background: var(--accent);
    color: white;
}

.primary-button:hover {
    background: var(--accent-hover);
}

.secondary-button {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Animation for menu items */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.submenu.active {
    display: block;
    animation: fadeIn 0.2s forwards;
}

.dialog-overlay.active {
    visibility: visible;
    opacity: 1;
}

/* Find and Replace Dialog */
.find-replace-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.find-replace-row {
    display: flex;
    gap: 10px;
}

.find-replace-row label {
    min-width: 80px;
}

.find-replace-row input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-color);
}

/* For fullscreen mode */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: var(--bg-gradient-2);
}

.fullscreen .editor {
    border-radius: 0;
}

/* Formatted text styling */
.editor b,
.editor strong {
    font-weight: bold;
}

.editor i,
.editor em {
    font-style: italic;
}

.editor u {
    text-decoration: underline;
}
