/* Notes View Styles */
.notes-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: calc(100vh - 90px);
    gap: 1rem;
    padding: 1rem;
    position: relative;
}

.notes-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notes-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.notes-search {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    color: var(--text-main);
    margin-top: 0.5rem;
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.note-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.note-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.note-item.active {
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--primary);
}

.note-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.note-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notes-editor-area {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-toolbar {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.1);
}

.editor-toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.editor-toolbar-right {
    display: flex;
    gap: 0.5rem;
}

.note-title-input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    width: 100%;
    padding: 0.25rem;
    outline: none;
}

.editor-content-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    overflow: hidden;
}

.note-editor-textarea {
    flex: 1;
    width: 100%;
    height: 100%;
    background: transparent;
    color: var(--text-main);
    border: none;
    padding: 1.5rem;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    resize: none;
    outline: none;
    line-height: 1.6;
}

.note-preview-area {
    flex: 1;
    height: 100%;
    padding: 2rem;
    overflow-y: auto;
    background: var(--bg-darker);
    display: none;
    border-left: 1px solid var(--border-subtle);
}

.note-preview-area.active {
    display: block;
}

/* Split View */
.editor-content-wrapper.split .note-editor-textarea {
    width: 50%;
    flex: none;
}

.editor-content-wrapper.split .note-preview-area {
    width: 50%;
    flex: none;
    display: block;
}

/* Markdown Styles */
.note-preview-area h1, 
.note-preview-area h2, 
.note-preview-area h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.note-preview-area h1 { border-bottom: 1px solid var(--border-subtle); padding-bottom: 0.5rem; }

.note-preview-area p { margin-bottom: 1rem; line-height: 1.6; }

.note-preview-area ul, .note-preview-area ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.note-preview-area blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 0.5rem 1rem;
    border-radius: 0 4px 4px 0;
}

.note-preview-area pre {
    background: #282c34;
    border-radius: 6px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.note-preview-area code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.note-preview-area p code {
    background: rgba(255,255,255,0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.empty-notes-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.empty-notes-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.mobile-only {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .notes-container {
        grid-template-columns: 1fr;
    }
    
    /* Default: Show List, Hide Editor */
    .notes-editor-area {
        display: none;
    }
    
    /* Mobile Edit Mode: Hide List, Show Editor */
    .notes-container.mobile-editing .notes-sidebar {
        display: none;
    }
    
    .notes-container.mobile-editing .notes-editor-area {
        display: flex;
    }
    
    .mobile-only {
        display: inline-block;
    }
}
