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

:root {
    --bg-primary: #1c1c1e;
    --bg-secondary: #2c2c2e;
    --bg-tertiary: #3a3a3c;
    --text-primary: #ffffff;
    --text-secondary: #98989d;
    --text-muted: #636366;
    --accent: #ffd60a;
    --accent-hover: #ffdf33;
    --border: #38383a;
    --danger: #ff453a;
    --note-hover: #3a3a3c;
    --note-selected: #ffcc00;
}

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

.app {
    display: flex;
    height: 100vh;
}

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

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-new {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-new:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 20px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.notes-list::-webkit-scrollbar {
    width: 6px;
}

.notes-list::-webkit-scrollbar-track {
    background: transparent;
}

.notes-list::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.note-item {
    padding: 14px 16px;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

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

.note-item.active {
    background: rgba(255, 214, 10, 0.15);
    border-left-color: var(--accent);
}

.note-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-item-preview {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.note-item-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* Editor */
.editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.editor-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 16px;
}

.empty-icon {
    opacity: 0.3;
}

.editor-empty p {
    font-size: 16px;
}

.editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 40px;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
}

.note-title {
    flex: 1;
    font-size: 28px;
    font-weight: 700;
    background: none;
    border: none;
    color: var(--text-primary);
    outline: none;
}

.note-title::placeholder {
    color: var(--text-muted);
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.btn-delete {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: rgba(255, 69, 58, 0.15);
    color: var(--danger);
}

.note-body {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.7;
    resize: none;
    outline: none;
    font-family: inherit;
}

.note-body::placeholder {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: absolute;
        z-index: 10;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .editor-content {
        padding: 20px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.note-item {
    animation: fadeIn 0.2s ease;
}
