/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* UPDATED: Darkened for WCAG AA Compliance (Contrast > 4.5:1) */
    --primary-color: #2E7D32; /* Previously #4CAF50 */
    --secondary-color: #1565C0; /* Previously #2196F3 */
    --danger-color: #d32f2f; /* Darkened from #f44336 */
    
    --bg-color: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --toolbar-bg: #f5f5f5;
    --editor-bg: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --hover-bg: #e8e8e8;
    --anchor-ad-height: 50px;
    --sidebar-width: 182px;
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --border-color: #333333;
    --toolbar-bg: #2a2a2a;
    --editor-bg: #1e1e1e;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    --hover-bg: #333333;
    --muted-text: #999;
    --light-border: #444;
    
    /* In dark mode, we can use slightly lighter variants for contrast against dark bg */
    --primary-color: #4CAF50; 
    --secondary-color: #64B5F6; 
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    overflow: hidden; /* Prevent body scroll */
}

/* Page Layout Wrappers */
.page-wrapper {
    display: flex;
    height: 100vh; 
    width: 100%;
    overflow: hidden;
}

.notes-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
    background-color: var(--toolbar-bg);
    border-right: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.notes-sidebar h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

#newNoteBtn {
    width: 100%;
    margin: 0.5rem 0 1rem 0;
}

.notes-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.note-item {
    padding: 0.4rem 0.3rem;
    background: var(--editor-bg);
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
}

.note-count {
    font-size: 0.7rem;
    color: var(--primary-color);
    margin-right: 4px;
    font-weight: 700;
    opacity: 0.8;
    min-width: 18px;
    text-align: center;
}

.note-item:hover {
    background: var(--hover-bg);
    transform: translateY(-1px);
}

/* Active Note Visual Indicator */
.note-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    border-left: 4px solid rgba(0,0,0,0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transform: translateX(2px);
}

.note-item.active .note-item-title,
.note-item.active .note-item-delete,
.note-item.active .note-item-rename,
.note-item.active .note-count { 
    color: white;
}

.note-item.active .note-count {
    opacity: 1;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 0 2px;
}

.note-item-title {
    flex: 1;
    font-weight: 500;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 0;
    transition: opacity 0.2s ease;
    line-height: 1.4;
}

.note-item-title.editing {
    display: none;
}

.note-item-rename-input {
    width: 100%;
    padding: 2px 4px;
    border: 1px solid var(--secondary-color);
    border-radius: 4px;
    outline: none;
    color: var(--text-color);
    background-color: var(--editor-bg);
    line-height: 1.4;
}

.note-item-rename.editing {
    display: none;
}

.note-item-actions {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: none;
    gap: 4px;
    padding-left: 6px;
    border-radius: 4px;
}

.note-item:hover .note-item-actions {
    display: flex;
    background-color: var(--hover-bg);
    box-shadow: -8px 0 8px var(--hover-bg);
}

.note-item.active:hover .note-item-actions {
     display: flex;
     background-color: var(--primary-color);
     box-shadow: -8px 0 8px var(--primary-color);
}

.note-action-btn {
    font-size: 0.85rem;
    padding: 4px;
    border-radius: 50%;
    line-height: 1;
    transition: background 0.2s;
}

.note-item-rename { color: var(--secondary-color); }
.note-item-delete { color: var(--danger-color); }

.note-item.active .note-action-btn:hover {
    background: rgba(0,0,0,0.2);
}

.note-item:not(.active) .note-action-btn:hover {
    background: rgba(0,0,0,0.1);
}

.main-content {
    flex-grow: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Container */
.container {
    display: flex;
    flex-direction: column;
    flex: 1;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

/* SEO Content Styles */
.seo-content {
    padding: 1.5rem 2rem;
    background-color: var(--toolbar-bg);
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-color);
}

.seo-container-dense {
    display: grid;
    grid-template-columns: 1fr 1.3fr 1fr;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.seo-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.seo-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 0.2rem 0;
    line-height: 1.2;
}

.seo-subtitle {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.3rem;
}

.seo-text {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.seo-mini-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.mini-feat {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-color);
    opacity: 0.85;
}

.mini-feat i {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Dark Mode Override for Icons */
body.dark-mode .mini-feat i {
    color: #64B5F6; /* Lighter blue for dark mode */
}

.seo-list-dense {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.seo-list-dense li {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0;
    display: block;
}

.seo-list-dense li i {
    color: var(--primary-color);
    font-size: 0.8rem;
    width: 20px;
    text-align: center;
    display: inline-block;
    margin-right: 0.4rem;
}

body.dark-mode .seo-list-dense li i {
    color: #4CAF50;
}

.seo-content b, 
.seo-content strong {
    font-weight: 700;
    color: var(--text-color);
}

.seo-content i, 
.seo-content em {
    font-style: italic;
}

.seo-content u {
    text-decoration: underline;
}

.seo-privacy-badge {
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.dark-mode .seo-privacy-badge {
    color: #4CAF50;
}

/* Footer Styles */
.site-footer {
    background-color: var(--toolbar-bg);
    padding: 0 2rem 1.5rem;
    margin-top: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-color);
    opacity: 0.6;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 1rem;
}

body.dark-mode .footer-content {
    border-top-color: rgba(255,255,255,0.05);
}

.footer-links {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.separator {
    opacity: 0.4;
}

.copyright {
    margin: 0;
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
        padding-bottom: 2rem; /* Added padding to prevent bottom cutoff */
    }

    .footer-links {
        flex-wrap: wrap; /* Allow links to wrap on small screens */
        justify-content: center;
        line-height: 1.6;
        gap: 0.5rem 1rem; /* Adjust gap for wrapped lines */
    }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background-color: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 250px;
    justify-content: center;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success { border-left: 4px solid var(--primary-color); }
.toast.error { border-left: 4px solid var(--danger-color); }
.toast i { font-size: 1rem; }

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--toolbar-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

body.dark-mode .logo i {
    color: #4CAF50;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.header-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.btn-toggle-notes {
    display: none;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background-color: var(--editor-bg);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    padding: 0.3rem 0.7rem;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.2;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1b5e20; /* Darker shade of new green */
    transform: translateY(-1px);
}

body.dark-mode .btn-primary {
    background-color: #4CAF50;
}
body.dark-mode .btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #0d47a1; /* Darker shade of new blue */
    transform: translateY(-1px);
}

body.dark-mode .btn-secondary {
    background-color: #64B5F6;
    color: #000;
}
body.dark-mode .btn-secondary:hover {
    background-color: #42A5F5;
}

/* Ad Slots */
.ad-slot {
    background-color: #f0f0f0;
    border: 1px dashed #ccc;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #888;
    text-align: center;
    padding: 0.5rem;
}

body.dark-mode .ad-slot {
    background-color: #222;
    border-color: #444;
    color: #666;
}

.ad-leaderboard-desktop { display: none; }
.ad-leaderboard-mobile { display: none; }

.ad-anchor-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--anchor-ad-height);
    background-color: var(--bg-color);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
    z-index: 2000;
    border-top: 1px solid var(--border-color);
}

#notesOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1999;
}

#notesOverlay.open {
    display: block;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--toolbar-bg);
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.5rem;
    border-right: 1px solid var(--border-color);
}

.toolbar-group:last-child {
    border-right: none;
}

.toolbar-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    background-color: var(--editor-bg);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.7rem;
}

.toolbar-btn:hover {
    background-color: var(--hover-bg);
    transform: scale(1.05);
}

.toolbar-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

body.dark-mode .toolbar-btn.active {
    background-color: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

.toolbar-select {
    padding: 0 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--editor-bg);
    color: var(--text-color);
    font-family: inherit;
    cursor: pointer;
    height: 24px;
    font-size: 0.7rem;
}

#fontSizeSelect {
    min-width: 60px;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27292.4%27%20height%3D%27292.4%27%3E%3Cpath%20fill%3D%27%23333333%27%20d%3D%27M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-13%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2013l128%20128c3.6%203.6%207.8%205.4%2013%205.4s9.4-1.8%2013-5.4l128-128c3.6-3.6%205.4-7.8%205.4-13%200-5-1.8-9.4-5.4-13z%27%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
    background-size: 0.6em auto;
    padding-right: 1.5rem;
}

body.dark-mode #fontSizeSelect {
     background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27292.4%27%20height%3D%27292.4%27%3E%3Cpath%20fill%3D%27%23e0e0e0%27%20d%3D%27M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-13%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2013l128%20128c3.6%203.6%207.8%205.4%2013%205.4s9.4-1.8%2013-5.4l128-128c3.6-3.6%205.4-7.8%205.4-13%200-5-1.8-9.4-5.4-13z%27%2F%3E%3C%2Fsvg%3E");
}

#fontSizeSelect:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(46, 125, 50, 0.3); /* Updated shadow color */
}

.ml-auto {
    margin-left: auto;
}

.color-pickers {
    align-items: center;
}

.color-tool {
    display: flex;
    align-items: center;
    position: relative;
    margin-right: 4px;
}

.toolbar-color-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    background-color: var(--editor-bg);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-color-label:hover {
    background-color: var(--hover-bg);
    transform: scale(1.05);
}

.toolbar-color-label i {
    pointer-events: none;
    font-size: 0.7rem;
}

.toolbar-color-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
        
.toolbar-hex-input {
    width: 70px;
    height: 24px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0 4px;
    font-size: 0.7rem;
    background-color: var(--editor-bg);
    color: var(--text-color);
    position: absolute;
    display: none;
    top: 0;
    left: 105%;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.color-tool:hover .toolbar-hex-input,
.color-tool:focus-within .toolbar-hex-input {
    display: block;
}

/* Editor Container */
.editor-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: var(--editor-bg);
}

.editor {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    outline: none;
    font-size: 14px;
    line-height: 1.3;
    color: var(--text-color);
    background-color: var(--editor-bg);
    min-height: 100%;
}

.editor:empty:before {
    content: "Start typing your notes here...";
    color: #999;
    font-style: italic;
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 1rem;
    background-color: var(--toolbar-bg);
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-color);
    flex-shrink: 0;
    min-height: 30px;
    position: relative;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.status-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    /* Desktop Default: Centered absolutely */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.status-right {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
}

.status-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.5;
    padding: 4px 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    border-radius: 4px;
}

.status-btn:hover {
    opacity: 1;
    color: var(--primary-color);
    background-color: var(--hover-bg);
}

.status-btn.active {
    color: var(--primary-color);
    opacity: 1;
}

body.dark-mode .status-btn.active {
    color: #4CAF50;
}

/* View Locked State */
body.view-locked .seo-content,
body.view-locked .site-footer {
    display: none !important;
}

body.view-locked .main-content {
    overflow: hidden;
}

body.view-locked .container {
    height: 100%;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--editor-bg);
    margin: 10% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.modal-content p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: var(--text-color);
}

.share-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.share-input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--editor-bg);
    color: var(--text-color);
    font-family: inherit;
}

.share-note {
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
}

/* NEW: Social Share Section Styles */
.social-share-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.social-share-label {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.social-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Brand Colors */
.whatsapp { background-color: #25D366; }
.facebook { background-color: #1877F2; }
.twitter { background-color: #1DA1F2; } /* Or black for X if preferred, keeping traditional blue for recognition */
.telegram { background-color: #0088cc; }


.download-options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.download-option-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    font-size: 1rem;
    width: 100%;
}

.download-option-btn i {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Full Width Mode */
body.full-width .notes-sidebar {
    display: none;
}

body.full-width .ad-slot-sidebar {
    display: none;
}

body.full-width .btn-toggle-notes {
    display: none;
}

body.full-width .main-content {
    width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .btn-toggle-notes {
        display: flex;
        background-color: var(--editor-bg);
        color: var(--text-color);
    }

    .notes-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 2000;
        transform: translateX(-100%);
        transition: transform 0.3s ease-out;
        box-shadow: 5px 0 15px rgba(0,0,0,0.2);
        background-color: var(--toolbar-bg); /* Explicit dark mode support */
    }
    
    .notes-sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        width: 100%;
    }

    .ad-leaderboard-desktop { display: none; }
    .ad-leaderboard-mobile { display: none; }

    .header {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.75rem;
        background-color: var(--toolbar-bg); /* Explicit dark mode support */
    }
    
    .header .logo {
        flex: 1;
    }

    .logo {
        gap: 0.5rem;
    }

    .logo h1 {
        font-size: 1.1rem;
        line-height: 1.2;
        color: var(--text-color);
    }

    .logo i {
        font-size: 1.2rem;
    }

    .header-actions {
        width: auto;
        justify-content: flex-end;
    }
    
    .header-actions #duplicateBtn {
        display: none;
    }

    .toolbar {
        padding: 0.5rem 1rem;
        gap: 0.5rem;
        background-color: var(--toolbar-bg); /* Explicit dark mode support */
    }

    .toolbar-group {
        padding: 0 0.25rem;
    }

    .editor {
        padding: 1rem;
    }

    /* UPDATED: Fix Status Bar on Mobile */
    .status-bar {
        flex-direction: row;
        justify-content: space-between;
        gap: 5px;
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        background-color: var(--toolbar-bg); /* Explicit dark mode support */
    }
    
    /* Remove absolute centering on mobile to prevent overlap */
    .status-center {
        position: static;
        transform: none;
        flex: 0 0 auto;
        order: 2; /* Place in middle visually if supported, or naturally */
    }
    
    .status-left {
        flex: 1;
        order: 1;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    
    .status-right {
        flex: 1;
        order: 3;
        justify-content: flex-end;
    }

    .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .logo h1 {
        font-size: 1.2rem;
    }
    
    .seo-content {
        padding: 1.5rem 1rem;
        background-color: var(--toolbar-bg); /* Explicit dark mode support */
    }
    
    .seo-container-dense {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .seo-mini-features {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .logo {
        gap: 0.4rem;
    }

    .logo i {
        font-size: 1.1rem;
    }

    .logo h1 {
        font-size: 1rem;
        white-space: nowrap;
    }

    .header-actions {
        display: flex;
        flex-direction: row;
        width: auto;
        gap: 0.5rem;
    }

    .header-actions #uploadBtn span,
    .header-actions #downloadBtn span,
    .header-actions #shareBtn span,
    .header-actions #darkModeBtn span {
         display: none;
    }

    .header-actions #uploadBtn,
    .header-actions #downloadBtn,
    .header-actions #shareBtn,
    .header-actions #darkModeBtn {
         font-size: 0.9rem;
         padding: 0;
         width: 32px;
         height: 32px;
         display: flex;
         align-items: center;
         justify-content: center;
    }

    .toolbar {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }

    .toolbar-group {
        border-right: none;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
        overflow: visible;
        font-family: var(--editor-font-family, 'Times New Roman', serif) !important;
        font-size: var(--editor-font-size, 12pt) !important;
        line-height: var(--editor-line-height, 1.5) !important;
    }

    .header,
    .toolbar,
    .status-bar,
    .modal,
    .notes-sidebar,
    .ad-anchor-bottom,
    .ad-slot,
    #notesOverlay,
    .btn-toggle-notes,
    .header-actions,
    .seo-content,
    .site-footer,
    #toast-container {
        display: none !important;
    }
    
    .page-wrapper {
        display: block;
        height: auto;
        overflow: visible;
    }

    .main-content {
        height: auto;
        overflow: visible;
        width: 100%;
        display: block;
    }

    .container {
        display: block;
        flex: none;
        height: auto;
        overflow: visible;
    }

    .editor-container {
        overflow: visible;
        display: block;
    }

    .editor {
        padding: 0;
        overflow: visible;
        box-shadow: none;
        border: none;
        font-family: inherit !important;
        font-size: inherit !important;
        line-height: inherit !important;
        height: auto !important;
    }
    
    .editor p, .editor li, .editor h1, .editor h2, .editor h3 {
        color: black !important;
    }
    
    .editor a {
        color: black !important;
        text-decoration: underline;
    }
}

/* Scrollbar Styling */
.editor::-webkit-scrollbar,
.notes-list::-webkit-scrollbar {
    width: 10px;
}

.editor::-webkit-scrollbar-track,
.notes-list::-webkit-scrollbar-track {
    background: var(--toolbar-bg);
}

.editor::-webkit-scrollbar-thumb,
.notes-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

.editor::-webkit-scrollbar-thumb:hover,
.notes-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Text Formatting Styles */
.editor h1 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 1rem;
}

.editor h2 {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.editor h3 {
    font-size: 1.17em;
    font-weight: 700;
    margin-bottom: 0.7rem;
}

.editor b, .editor strong {
    font-weight: 700;
}

.editor i, .editor em {
    font-style: italic;
}

.editor u {
    text-decoration: underline;
}

.editor s {
    text-decoration: line-through;
}

.editor a {
    color: var(--secondary-color);
    text-decoration: underline;
}

.editor ul {
    list-style-type: disc;
    margin-left: 2rem;
    margin-bottom: 0.5rem;
    margin-top: 0.2rem;
}

.editor ol {
    list-style-type: decimal;
    margin-left: 2rem;
    margin-bottom: 0.5rem;
    margin-top: 0.2rem;
}

.editor li {
    margin-bottom: 0.2rem;
    line-height: 1.4;
}