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

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #FFF8DC;
    color: #222222;
    line-height: 1.5;
    font-size: 16px;
    overflow-x: hidden;
}

/* App Container */
#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* Top Header */
.top-header {
    background-color: #FFFFFF;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid #F0F0F0;
    z-index: 1000;
    position: relative;
}

.header-left {
    position: absolute;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle-btn {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    color: #333333;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background-color: #F5F5F5;
}

.site-title {
    font-size: 22px;
    font-weight: 500;
    color: #333333;
}

/* Logo Image */
.logo-image {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.header-nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    color: #333333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #4A90E2;
}

/* Donate Button */
.donate-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #333333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    transition: color 0.2s ease;
}

.donate-btn:hover {
    color: #4A90E2;
}

.donate-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #FDF5D3;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #E5DDB3;
    transition: transform 0.3s ease;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* New Note Button */
.new-note-container {
    padding: 16px;
}

.new-note-btn {
    width: 100%;
    background-color: #EFEFEF;
    border: none;
    border-radius: 4px;
    padding: 16px;
    font-size: 16px;
    font-weight: 500;
    color: #333333;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.new-note-btn:hover {
    background-color: #E5E5E5;
}

.new-note-btn:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* Notes List */
.notes-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
}

.notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.note-item {
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #333333;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    display: flex;
    justify-content: space-between;
    align-items: center;
    group: note;
}

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

.note-item.active {
    background-color: #EAE2B8;
}

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

.note-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.note-title:hover {
    background-color: rgba(74, 144, 226, 0.05);
}

.note-title.editing {
    background-color: #FFFFFF;
    border: 2px solid #4A90E2;
    outline: none;
    cursor: text;
    white-space: normal;
    word-wrap: break-word;
    min-height: 16px;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.note-title.editing:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.note-delete-btn {
    display: none;
    background: none;
    border: none;
    color: #999999;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 2px;
    transition: color 0.2s ease;
}

.note-item:hover .note-delete-btn {
    display: block;
}

.note-delete-btn:hover {
    color: #E74C3C;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #E5DDB3;
}

.language-selector {
    margin-bottom: 16px;
}

.language-selector label {
    display: block;
    font-size: 12px;
    color: #666666;
    margin-bottom: 4px;
}

.language-selector select {
    width: 100%;
    padding: 8px;
    border: 1px solid #DDDDDD;
    border-radius: 4px;
    background-color: #FFFFFF;
    font-size: 14px;
    color: #333333;
}

.language-selector select option:disabled {
    color: #AAAAAA;
    font-style: italic;
}

.soon-indicator {
    font-size: 10px;
    color: #999999;
    font-style: italic;
}

.footer-links {
    text-align: center;
}

.footer-link {
    color: #777777;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #4A90E2;
}

/* Editor Area */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #FFF8DC;
    min-width: 0;
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background-color: #FFF8DC;
    border-bottom: 1px solid #F0EAC0;
    flex-wrap: wrap;
    gap: 8px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Heading Dropdown */
.heading-dropdown {
    padding: 6px 12px;
    border: 1px solid #DDDDDD;
    border-radius: 4px;
    background-color: #FFFFFF;
    font-size: 14px;
    color: #333333;
    cursor: pointer;
    margin-right: 8px;
}

/* Toolbar Buttons */
.toolbar-btn {
    background: none;
    border: none;
    color: #444444;
    font-size: 14px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.toolbar-btn:hover {
    color: #4A90E2;
    background-color: rgba(74, 144, 226, 0.1);
}

.toolbar-btn:focus {
    outline: 2px solid rgba(74, 144, 226, 0.3);
    outline-offset: 1px;
}

.toolbar-btn.active {
    color: #4A90E2;
    background-color: rgba(74, 144, 226, 0.15);
}

/* File Action Buttons */
.file-action-btn {
    background-color: #FAFAFA;
    border: 1px solid #DDDDDD;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    color: #333333;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-action-btn:hover {
    background-color: #F1F1F1;
}

.file-action-btn:focus {
    outline: 2px solid rgba(74, 144, 226, 0.3);
    outline-offset: 1px;
}

/* Text Editor */
.text-editor {
    flex: 1;
    padding: 32px;
    background-color: #FFF8DC;
    border: none;
    outline: none;
    font-size: 16px;
    line-height: 1.5;
    color: #222222;
    font-family: 'Roboto', Arial, sans-serif;
    overflow-y: auto;
    word-wrap: break-word;
}

.text-editor:focus {
    outline: none;
}

.text-editor h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    margin: 16px 0;
    color: #222222;
}

.text-editor h2 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    margin: 12px 0;
    color: #222222;
}

.text-editor p {
    margin: 8px 0;
    color: #222222;
}

.text-editor ul,
.text-editor ol {
    margin: 8px 0;
    padding-left: 24px;
}

.text-editor li {
    margin: 4px 0;
    color: #222222;
}

.text-editor strong {
    font-weight: 700;
}

.text-editor em {
    font-style: italic;
}

/* Text Alignment Classes */
.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* Status Bar */
.status-bar {
    height: 30px;
    background-color: #FFF8DC;
    border-top: 1px solid #F0EAC0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 24px;
}

.status-counters {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #666666;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar-toggle-btn {
        display: block;
    }

    .header-nav {
        gap: 16px;
    }

    .nav-link {
        font-size: 14px;
    }

    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        height: calc(100vh - 60px);
        z-index: 1000;
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .editor-area {
        width: 100%;
    }

    .editor-toolbar {
        padding: 8px 16px;
        flex-wrap: wrap;
    }

    .toolbar-left {
        flex-wrap: wrap;
    }

    .toolbar-btn {
        min-width: 40px;
        height: 40px;
        padding: 10px;
    }

    .file-action-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .text-editor {
        padding: 16px;
    }

    .status-bar {
        padding: 0 16px;
    }

    .status-counters {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 18px;
    }

    .header-nav {
        gap: 12px;
    }

    .nav-link {
        font-size: 13px;
    }

    .toolbar-left {
        gap: 2px;
    }

    .toolbar-btn {
        min-width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .file-action-btn {
        padding: 6px 10px;
        font-size: 12px;
        gap: 4px;
    }

    .text-editor {
        padding: 12px;
        font-size: 15px;
    }

    .status-counters {
        font-size: 11px;
        gap: 8px;
    }
}

/* Scrollbar Styling */
.notes-list-container::-webkit-scrollbar,
.text-editor::-webkit-scrollbar {
    width: 6px;
}

.notes-list-container::-webkit-scrollbar-track,
.text-editor::-webkit-scrollbar-track {
    background: transparent;
}

.notes-list-container::-webkit-scrollbar-thumb,
.text-editor::-webkit-scrollbar-thumb {
    background: #CCCCCC;
    border-radius: 3px;
}

.notes-list-container::-webkit-scrollbar-thumb:hover,
.text-editor::-webkit-scrollbar-thumb:hover {
    background: #AAAAAA;
}

/* Placeholder styling */
.text-editor:empty:before {
    content: "Start typing your note here...";
    color: #999999;
    font-style: italic;
    pointer-events: none;
}

/* Custom Delete Modal */
.delete-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.delete-modal.hidden {
    display: none;
}

.delete-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.delete-modal-content {
    position: relative;
    background-color: #FDF5D3;
    border: 2px solid #E5DDB3;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    animation: modalSlideIn 0.3s ease-out;
}

.delete-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #E5DDB3;
}

.delete-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin: 0;
}

.delete-modal-body {
    padding: 20px 24px;
}

.delete-modal-message {
    font-size: 15px;
    color: #555555;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.delete-modal-note-title {
    font-size: 14px;
    color: #4A90E2;
    font-weight: 500;
    background-color: #FFF8DC;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #F0EAC0;
    margin: 0;
    word-break: break-word;
}

.delete-modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.delete-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.cancel-btn {
    background-color: #F5F5F5;
    color: #666666;
    border: 1px solid #DDDDDD;
}

.cancel-btn:hover {
    background-color: #EEEEEE;
    color: #444444;
}

.confirm-btn {
    background-color: #E74C3C;
    color: white;
    border: 1px solid #C0392B;
}

.confirm-btn:hover {
    background-color: #C0392B;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

.delete-modal-btn:focus {
    outline: 2px solid rgba(74, 144, 226, 0.3);
    outline-offset: 2px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .delete-modal-content {
        width: 95%;
        max-width: none;
    }
    
    .delete-modal-header,
    .delete-modal-body,
    .delete-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .delete-modal-footer {
        flex-direction: column;
    }
    
    .delete-modal-btn {
        width: 100%;
    }
}