body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: white;
    color: #333;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #f9f9f9;
    border-bottom: 1px solid #ddd;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
}

header h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: normal;
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 20%;
    min-width: 200px;
    background-color: #f7f7f7;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 0.8rem;
    font-size: 0.8rem;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: #333;
    background-color: #f0f0f0;
}

.tab-btn.active {
    color: #333;
    border-bottom: 2px solid #333;
}

.sidebar-header {
    padding: 0.8rem 1rem;
    font-weight: bold;
    color: #666;
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fafafa;
}

.icon-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 0.4rem;
    border-radius: 4px;
}

.icon-btn:hover {
    color: #333;
    background-color: #e0e0e0;
}

.note-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.note-item {
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.note-item:hover {
    background-color: #efefef;
}

.note-item.active {
    background-color: #e0e0e0;
    font-weight: bold;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.category-item:hover {
    background-color: #efefef;
}

.category-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid #ccc;
    flex-shrink: 0;
}

.cat-edit-btn {
    opacity: 0;
    font-size: 0.8rem;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
}

.category-item:hover .cat-edit-btn {
    opacity: 1;
}

.cat-edit-btn:hover {
    color: #333;
    background-color: #ddd;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid #888;
    width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.modal-content h2 {
    margin-top: 0;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #333;
    transform: scale(1.1);
}

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

.secondary-btn {
    padding: 0.6rem 1rem;
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.secondary-btn:hover {
    background-color: #f0f0f0;
}

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

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1001;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-top: 5px;
}

.dropdown-content button {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.dropdown-content button:hover {
    background-color: #f1f1f1;
}

.dropdown-content hr {
    margin: 0;
    border: 0;
    border-top: 1px solid #eee;
}

.show {
    display: block;
}

/* Editor Area Styles */
.editor-area {
    flex: 1;
    padding: 1rem 2rem;
    overflow-y: auto;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
}

.note-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    min-height: 50px;
}

.note-title {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

.note-title-input {
    font-size: 2rem;
    font-weight: bold;
    padding: 0.2rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    margin-right: 1rem;
}

.category-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
}

.category-select {
    padding: 0.2rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.action-btn:hover {
    background-color: #e0e0e0;
}

.delete-btn {
    color: #cc0000;
    border-color: #ffcccc;
    background-color: #fff0f0;
}

.delete-btn:hover {
    background-color: #ffe0e0;
    border-color: #ffaaaa;
}

.note-content {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #222;
    min-height: 500px;
}

.note-editor {
    width: 100%;
    min-height: 500px;
    font-family: monospace;
    font-size: 1rem;
    line-height: 1.5;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    outline: none;
}

/* Markdown Styles */
.note-content h1 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3rem;
}

.note-content h2 {
    font-size: 1.3rem;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
}

.note-content h3 {
    font-size: 1.1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.note-content p {
    margin-bottom: 1rem;
}

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

.note-content li {
    margin-bottom: 0.3rem;
}

.note-content code {
    background-color: #f0f0f0;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
}

.note-content pre {
    background-color: #f0f0f0;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
}