:root {
    --bg-color: #f8f9fa;
    --sidebar-bg: #ffffff;
    --border-color: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent-color: #007bff;
    --accent-hover: #0056b3;
    --danger-color: #dc3545;
    --danger-hover: #bd2130;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-color);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--accent-color);
}

.search-container {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

#search-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: var(--bg-color);
    transition: var(--transition);
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.note-list {
    flex: 1;
    overflow-y: auto;
}

.note-item {
    padding: 16px 24px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.note-item:hover {
    background-color: var(--bg-color);
}

.note-item.active {
    background-color: #e7f1ff;
    border-left: 4px solid var(--accent-color);
}

.note-item-content {
    flex: 1;
    min-width: 0;
}

.note-item-title {
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-item-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-inline-btn {
    opacity: 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 8px;
}

.note-item:hover .delete-inline-btn {
    opacity: 1;
}

.delete-inline-btn:hover {
    color: var(--danger-color);
    background-color: #fff5f5;
}

/* Editor */
.editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

.empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

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

.editor-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
}

#note-title {
    flex: 1;
    border: none;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

#note-title:focus {
    outline: none;
}

.editor-body {
    flex: 1;
    padding: 24px;
}

#note-body {
    width: 100%;
    height: 100%;
    border: none;
    resize: none;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
    font-family: inherit;
}

#note-body:focus {
    outline: none;
}

.editor-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.95rem;
}

.btn.primary {
    background-color: var(--accent-color);
    color: white;
    width: 100%;
}

.btn.primary:hover {
    background-color: var(--accent-hover);
}

.btn.danger {
    background-color: transparent;
    color: var(--text-secondary);
}

.btn.danger:hover {
    color: var(--danger-color);
    background-color: #fff5f5;
}

/* Utils */
.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 10px;
}

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

@media (max-width: 768px) {
    .sidebar {
        width: 260px;
    }
}
