/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #000;
    background-color: #fff;
}

/* ASCII Art */
.ascii-art-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    overflow: auto;
}

.ascii-art {
    font-family: 'Courier New', Courier, monospace;
    font-size: 8px;
    line-height: 1.1;
    color: #000;
    white-space: pre;
    margin: 0;
}

.pwa-prompt {
    margin-top: 20px;
    font-size: 12px;
    color: #666;
    text-align: center;
}

@media (max-width: 768px) {
    .ascii-art {
        font-size: 5px;
    }

    .pwa-prompt {
        font-size: 10px;
    }
}

/* Auth Pages */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    border: 0.5px solid #000;
}

.auth-container h1 {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: normal;
}

.auth-container h2 {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: normal;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 5px;
    border: 0.5px solid #000;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
}

button {
    padding: 5px 15px;
    border: 0.5px solid #000;
    background-color: #fff;
    cursor: pointer;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
}

button:hover {
    background-color: #f0f0f0;
}

.auth-link {
    margin-top: 20px;
    font-size: 12px;
}

.auth-link a {
    color: blue;
    text-decoration: underline;
}

.pwa-notice {
    padding: 12px;
    margin-bottom: 20px;
    border: 0.5px solid #000;
    background-color: #e8f4ff;
    font-size: 12px;
    line-height: 1.6;
}

.error {
    padding: 10px;
    margin-bottom: 15px;
    border: 0.5px solid #000;
    background-color: #ffe0e0;
}

.success {
    padding: 10px;
    margin-bottom: 15px;
    border: 0.5px solid #000;
    background-color: #e0ffe0;
}

/* Editor Layout */
.editor-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    border-right: 0.5px solid #000;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    transition: margin-left 0.3s;
    position: relative;
}

.sidebar.collapsed {
    margin-left: -250px;
}

/* Toggle button that stays visible when collapsed */
.sidebar-toggle-overlay {
    position: absolute;
    top: 15px;
    right: -30px;
    z-index: 1000;
    display: none;
}

.sidebar.collapsed .sidebar-toggle-overlay {
    display: block;
}

.sidebar-toggle-overlay button {
    padding: 5px 8px;
    border: 0.5px solid #000;
    background-color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 0.5px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: normal;
}

.toggle-btn {
    padding: 2px 8px;
    font-size: 12px;
}

.sidebar-actions {
    padding: 15px;
    border-bottom: 0.5px solid #000;
}

.action-btn {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 5px;
    text-align: center;
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    border-bottom: 0.5px solid #000;
}

.note-item {
    padding: 10px 15px;
    border-bottom: 0.5px solid #ccc;
    cursor: pointer;
}

.note-item:hover {
    background-color: #f5f5f5;
}

.note-item .note-title {
    font-weight: bold;
    margin-bottom: 3px;
}

.note-item .note-date {
    font-size: 11px;
    color: #666;
}

.no-notes {
    padding: 15px;
    text-align: center;
    color: #666;
    font-size: 12px;
}

.sidebar-footer {
    padding: 15px;
    display: flex;
    justify-content: space-between;
}

.sidebar-footer a {
    color: blue;
    text-decoration: underline;
    font-size: 12px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

.tabs-container {
    border-bottom: 0.5px solid #000;
    display: flex;
    overflow-x: auto;
    min-height: 35px;
    max-height: 35px;
    background-color: #f5f5f5;
    flex-shrink: 0;
}

.note-tab {
    padding: 8px 15px;
    border-right: 0.5px solid #000;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #f5f5f5;
}

.note-tab:hover {
    background-color: #e0e0e0;
}

.note-tab.active {
    background-color: #fff;
}

.tab-close {
    cursor: pointer;
    font-weight: bold;
    padding: 0 5px;
}

.tab-close:hover {
    color: red;
}

/* Empty State */
.empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666;
}

/* Editor Area */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.note-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

.editor-controls {
    margin-bottom: 10px;
    flex-shrink: 0;
}

.note-title-input {
    width: 100%;
    padding: 8px;
    border: 0.5px solid #000;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.editor-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.font-select {
    padding: 5px;
    border: 0.5px solid #000;
    font-family: Helvetica, Arial, sans-serif;
}

.delete-btn {
    padding: 5px 15px;
    border: 0.5px solid #000;
    background-color: #fff;
    color: #000;
}

.delete-btn:hover {
    background-color: #ffe0e0;
}

.note-textarea {
    flex: 1;
    width: 100%;
    padding: 10px;
    border: 0.5px solid #000;
    font-size: 14px;
    resize: none;
    line-height: 1.6;
    min-height: 0;
    height: 100%;
}

.note-textarea:focus {
    outline: none;
    border: 1px solid #000;
}

/* Settings Page */
.settings-container {
    max-width: 600px;
    margin: 30px auto;
    padding: 20px;
    border: 0.5px solid #000;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 0.5px solid #000;
}

.settings-header h1 {
    font-size: 20px;
    font-weight: normal;
}

.back-link {
    color: blue;
    text-decoration: underline;
    font-size: 14px;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.settings-section {
    padding-bottom: 20px;
    border-bottom: 0.5px solid #ccc;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h2 {
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 15px;
}

.settings-section p {
    margin-bottom: 10px;
}

#password-message {
    margin-top: 15px;
}

.message {
    padding: 10px;
    border: 0.5px solid #000;
    margin-top: 10px;
}

.message.success {
    background-color: #e0ffe0;
}

.message.error {
    background-color: #ffe0e0;
}

/* Scrollbar Styling (minimal) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border: 0.5px solid #000;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}
