/* Windows Notepad Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: 11px;
    background: #c0c0c0;
    overflow: hidden;
}

.notepad-window {
    width: 100vw;
    height: 100vh;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    display: flex;
    flex-direction: column;
}

/* Title Bar */
.title-bar {
    background: linear-gradient(to right, #0a51a0, #3a6bb0);
    color: white;
    height: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
    font-weight: bold;
    font-size: 11px;
}

.title-text {
    padding-left: 4px;
}

.window-controls {
    display: flex;
    gap: 1px;
}

.control-btn {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    font-size: 11px;
    font-family: 'Segoe UI', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
}

.control-btn:hover {
    background: #e0e0e0;
}

.close-btn:hover {
    background: #ff4444;
    color: white;
}

/* Menu Bar */
.menu-bar {
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
    height: 20px;
    display: flex;
    align-items: center;
    padding: 0 2px;
}

.menu-item {
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    user-select: none;
}

.menu-item:hover {
    background: #0078d4;
    color: white;
}

.menu-item.active {
    background: #0078d4;
    color: white;
}

/* Dropdown Menus */
.dropdown-menu {
    position: absolute;
    background: white;
    border: 2px outset #c0c0c0;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    z-index: 1000;
    min-width: 200px;
    display: none;
    top: 42px;
}

.dropdown-menu.show {
    display: block;
}

.menu-option {
    padding: 4px 20px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.menu-option:hover {
    background: #0078d4;
    color: white;
}

.menu-option.disabled {
    color: #808080;
    cursor: default;
}

.menu-option.disabled:hover {
    background: white;
    color: #808080;
}

.shortcut {
    color: #808080;
    font-size: 10px;
}

.menu-option:hover .shortcut {
    color: white;
}

.menu-divider {
    height: 1px;
    background: #c0c0c0;
    margin: 2px 0;
}

/* Text Editor */
.editor-container {
    flex: 1;
    padding: 2px;
    background: #c0c0c0;
}

#text-editor {
    width: 100%;
    height: 100%;
    border: 2px inset #c0c0c0;
    background: white;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    padding: 4px;
    resize: none;
    outline: none;
    line-height: 1.2;
}

#text-editor.word-wrap {
    white-space: pre-wrap;
    word-wrap: break-word;
}

#text-editor:not(.word-wrap) {
    white-space: pre;
    overflow-x: auto;
}

/* Status Bar */
.status-bar {
    background: #c0c0c0;
    border-top: 1px solid #808080;
    height: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    font-size: 11px;
}

.status-bar.hidden {
    display: none;
}

/* Dialogs */
.dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.dialog.show {
    display: flex;
}

.dialog-content {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    min-width: 300px;
    max-width: 500px;
}

.dialog-header {
    background: linear-gradient(to right, #0a51a0, #3a6bb0);
    color: white;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 11px;
}

.dialog-body {
    padding: 16px;
}

.dialog-body label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
}

.dialog-body input[type="text"], .dialog-body select {
    width: 100%;
    padding: 2px 4px;
    border: 2px inset #c0c0c0;
    font-size: 11px;
    margin-bottom: 8px;
}

.dialog-options {
    margin-top: 12px;
}

.dialog-options label {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    cursor: pointer;
}

.dialog-options input[type="checkbox"] {
    margin-right: 6px;
    width: auto;
}

.dialog-buttons {
    padding: 8px 16px;
    text-align: right;
    border-top: 1px solid #808080;
}

.dialog-buttons button {
    margin-left: 8px;
    padding: 2px 16px;
    border: 2px outset #c0c0c0;
    background: #c0c0c0;
    font-size: 11px;
    cursor: pointer;
    min-width: 70px;
}

.dialog-buttons button:hover {
    background: #e0e0e0;
}

.dialog-buttons button:active {
    border: 2px inset #c0c0c0;
}

/* Font Dialog Specific */
.font-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.font-style {
    margin-bottom: 12px;
}

.font-style label {
    display: inline-flex;
    align-items: center;
    margin-right: 16px;
    cursor: pointer;
}

.font-preview {
    border: 2px inset #c0c0c0;
    padding: 8px;
    background: white;
    height: 40px;
    display: flex;
    align-items: center;
}

#font-sample {
    font-size: 16px;
    margin-left: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .font-options {
        grid-template-columns: 1fr;
    }
    
    .dialog-content {
        min-width: 280px;
        margin: 0 10px;
    }
}

/* Hide elements */
.hidden {
    display: none !important;
}