@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
/* All CSS Code */
:root {
    --primary: #3a86ff;
    --secondary: #8338ec;
    --success: #06d6a0;
    --danger: #ef476f;
    --dark: #1d3557;
    --dark-text: #f8f9fa;
    --light: #f8f9fa;
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Poppins', sans-serif;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #f0f4f8;
}

body {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, var(--dark), #2a4365);
    color: white;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    box-shadow: var(--box-shadow);
    overflow-y: auto;
    transition: var(--transition);
    position: relative;
    z-index: 10;
    height: 100vh;
}

.sidebar.collapsed {
    width: 70px;
}

.app-title {
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 25px;
    transition: var(--transition);
}

.app-title i {
    font-size: 24px;
    margin-right: 12px;
    color: var(--primary);
}

.app-title h1 {
    font-size: 20px;
    font-weight: 600;
}

.toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 20px;
    transition: var(--transition);
    z-index: 2;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toggle-btn:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Collapsed sidebar styling */
.sidebar.collapsed {
    display: flex;
    align-items: center;
}

.sidebar.collapsed .app-title,
.sidebar.collapsed .note-list,
.sidebar.collapsed .new-note-btn span {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.sidebar.collapsed .new-note-btn {
    margin: 0 15px;
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
}

.sidebar.collapsed .new-note-btn i {
    margin: 0;
}

.sidebar.collapsed .toggle-btn {
    position: relative;
    margin: 15px auto;
    top: 0;
    right: 0;
}

.new-note-btn {
    margin: 0 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.new-note-btn1 {
    margin: 0 0px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.new-note-btn i {
    margin-right: 10px;
    font-size: 16px;
}

.new-note-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.note-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.note-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 15px;
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}

.note-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.note-item.active {
    background: var(--primary);
    border-left: 4px solid var(--success);
}

.note-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.delete-btn {
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

.delete-btn:hover {
    opacity: 1;
    color: var(--danger);
}

/* Main Content Area */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 25px;
    background: white;
    box-shadow: var(--box-shadow);
    border-radius: 15px;
    margin: 15px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    height: calc(100vh - 30px);
    box-sizing: border-box;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.top-bar h2 {
    margin: 0;
    font-size: 22px;
    color: var(--dark);
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.top-bar h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 10px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.save-btn, .rename-btn, .export-btn {
    padding: 8px 16px;
    font-size: 14px;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.save-btn:hover, .rename-btn:hover, .export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.save-btn {
    background: var(--success);
}

.save-btn:hover {
    background: #05b085;
}

.rename-btn {
    background: var(--secondary);
}

.rename-btn:hover {
    background: #7026d9;
}

.export-btn {
    background: #ff9f1c;
    position: relative;
}

.export-btn:hover {
    background: #f08700;
}

/* Dropdown menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: var(--border-radius);
    top: 100%;
    left: 0;
    margin-top: 5px;
    overflow: hidden;
}

.dropdown-content a {
    color: #4a5568;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
    color: var(--primary);
}

.dropdown-content a i {
    width: 20px;
    text-align: center;
}

.dropdown-content.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

.note-container {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

textarea {
    width: 100%;
    height: 83vh;
    padding: 25px;
    font-size: 18px;
    line-height: 1.8;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    outline: none;
    resize: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
}

textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.2);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Rename Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal.show {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    width: 400px;
    max-width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    transition: var(--transition);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal h3 {
    margin-bottom: 15px;
    color: var(--dark);
}

.modal input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-family: 'Poppins', sans-serif;
}

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

.modal-btn {
    padding: 8px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.modal-btn.cancel {
    background: #e2e8f0;
    color: #4a5568;
}

.modal-btn.confirm {
    background: var(--primary);
    color: white;
}

.modal-btn:hover {
    opacity: 0.9;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #a0aec0;
    text-align: center;
    padding: 20px;
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    color: #cbd5e0;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #4a5568;
}

.empty-state p {
    max-width: 300px;
    margin-bottom: 20px;
}

/* Character count */
.char-count {
    position: absolute;
    right: 15px;
    bottom: 15px;
    font-size: 12px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    z-index: 1;
}

/* Dark theme specific styles for char count */
.theme-dark .char-count {
    background: rgba(45, 45, 45, 0.9);
    color: #94a3b8;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 100;
        width: 85%;
        max-width: 320px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .mobile-toggle {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 101;
        background: var(--primary);
        color: white;
        border: none;
        width: 45px;
        height: 45px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        font-size: 18px;
    }
    
    .container {
        margin: 10px;
        margin-top: 70px;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 12px;
    }
    
    .top-bar h2 {
        margin-bottom: 15px;
    }
    
    .action-buttons {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .save-btn, .rename-btn, .export-btn {
        flex: 1;
        justify-content: center;
        min-width: 110px;
    }
    
    .dropdown-content {
        left: 0;
        right: 0;
        width: 100%;
    }
    
    textarea {
        padding: 15px;
        font-size: 16px;
    }
}

/* Larger mobile phones */
@media (max-width: 480px) {
    .container {
        margin: 8px;
        margin-top: 65px;
        padding: 15px;
    }
    
    textarea {
        padding: 12px;
    }
}

/* Settings Button */
.settings-btn {
    margin: 0 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 17px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.settings-btn i {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.sidebar.collapsed .settings-btn span {
    display: none;
}

.sidebar.collapsed .settings-btn {
    padding: 12px 0;
    justify-content: center;
}

.sidebar.collapsed .settings-btn i {
    margin: 0;
}

.search-container {
    padding: 0px 20px;
    margin: 10px 0;
    transition: var(--transition);
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
}

#searchNotes {
    width: 100%;
    padding: 11px 6px 10px 35px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    font-size: 14px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3sease;
}

#searchNotes::placeholder {
    color: #94a3b8;
}

#searchNotes:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Add highlight class for search results */
.highlight {
    background-color: rgba(255, 255, 0, 0.3);
}

.sidebar-footer {
    margin-top: auto;
    padding:10px 0px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-btn {
    margin: 0 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 17px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.theme-btn i {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.sidebar.collapsed .theme-btn span,
.sidebar.collapsed .settings-btn span {
    display: none;
}

.sidebar.collapsed .theme-btn,
.sidebar.collapsed .settings-btn {
    margin: 0 15px;
    width: 50px;
    height: 40px;
    padding: 0;
    justify-content: center;
}

.sidebar.collapsed .theme-btn i,
.sidebar.collapsed .settings-btn i {
    margin: 0;
}

/* Dark theme specific styles for theme button */
.theme-dark .theme-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.theme-dark .theme-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Dark theme specific styles for search input */
.theme-dark .search-input-wrapper .search-icon {
    color: #94a3b8;
}

.theme-dark #searchNotes {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-dark #searchNotes:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    flex-wrap: wrap;
    gap: 10px;
}

.editor-modes,
.view-modes,
.formatting-tools {
    display: flex;
    gap: 5px;
    align-items: center;
}

.formatting-tools {
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn,
.view-btn,
.format-btn {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    color: #4a5568;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.format-btn {
    padding: 8px;
}

.mode-btn:hover,
.view-btn:hover,
.format-btn:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.mode-btn.active,
.view-btn.active,
.format-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    margin: 0 5px;
}

/* Dark theme support for toolbar */
.theme-dark .editor-toolbar {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.theme-dark .mode-btn,
.theme-dark .view-btn,
.theme-dark .format-btn {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.theme-dark .mode-btn:hover,
.theme-dark .view-btn:hover,
.theme-dark .format-btn:hover {
    background: var(--highlight-bg);
}

.theme-dark .mode-btn.active,
.theme-dark .view-btn.active,
.theme-dark .format-btn.active {
    background: var(--primary);
    color: white;
}

.theme-dark .toolbar-separator {
    background: var(--border-color);
}

/* Responsive toolbar */
@media (max-width: 768px) {
    .editor-toolbar {
        padding: 8px;
        gap: 8px;
    }

    .formatting-tools {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .format-btn {
        padding: 6px;
        min-width: 32px;
        height: 32px;
    }
}

/* Editor Container */
.editor-container {
    display: flex;
    gap: 20px;
    height: 100%;
    position: relative;
}

.markdown-preview {
    display: none;
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Split View Styles */
.editor-container.split-view {
    flex-direction: row;
}

.editor-container.split-view textarea,
.editor-container.split-view .markdown-preview {
    flex: 1;
    display: block;
}

.editor-container.split-view textarea {
    border-radius: 0 0 0 var(--border-radius);
}

.editor-container.split-view .markdown-preview {
    border-radius: 0 0 var(--border-radius) 0;
}

/* Preview Only Mode */
.editor-container.preview-only textarea {
    display: none;
}

.editor-container.preview-only .markdown-preview {
    display: block;
}

/* Dark Theme Support */
.theme-dark .editor-toolbar {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.theme-dark .mode-btn,
.theme-dark .view-btn,
.theme-dark .format-btn {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.theme-dark .mode-btn:hover,
.theme-dark .view-btn:hover,
.theme-dark .format-btn:hover {
    background: var(--highlight-bg);
}

.theme-dark .mode-btn.active,
.theme-dark .view-btn.active,
.theme-dark .format-btn.active {
    background: var(--primary);
    color: white;
}

.theme-dark .markdown-preview {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Markdown Preview Customization */
.markdown-preview {
    font-family: 'Poppins', sans-serif;
}

.markdown-preview pre {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 15px;
}

.theme-dark .markdown-preview pre {
    background: var(--highlight-bg);
}

/* Adjust textarea for new layout */
textarea {
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    height: 75vh;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 0 10px;
}

.social-links a {
    color: #666;
    font-size: 20px;
    transition: color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.05);
}

.social-links a:hover {
    color: #3a86ff;
    transform: translateY(-2px);
}

/* Dark theme styles for social links */
.theme-dark .social-links a {
    color: #999;
    background-color: rgba(255, 255, 255, 0.05);
}

.theme-dark .social-links a:hover {
    color: #3a86ff;
}

.sidebar.collapsed .social-links {
    display: none;
} 