:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #cccccc;
    --border-light: #eeeeee;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-strong: rgba(0, 0, 0, 0.15);
    --highlight-bg: #f0f0f0;
    --input-border: #cccccc;
    --input-focus: #007BFF;
    --button-primary: #007BFF;
    --button-hover: #0056b3;
    --menu-bg: #ffffff;
    --menu-text: #333333;
    --menu-hover: #f0f0f0;
    --menu-border: #dddddd;
    --toggle-color: #cfcfcf;
    --bar-color: #8f8f8f;
    --text-shadow: rgba(0, 0, 0, 0.2);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1e1e1e;
        --bg-secondary: #2d2d2d;
        --text-primary: #e0e0e0;
        --text-secondary: #a0a0a0;
        --border-color: #444444;
        --border-light: #333333;
        --shadow-color: rgba(0, 0, 0, 0.3);
        --shadow-strong: rgba(0, 0, 0, 0.5);
        --highlight-bg: #3a3a3a;
        --input-border: #444444;
        --input-focus: #4a9eff;
        --button-primary: #0d6efd;
        --button-hover: #0b5ed7;
        --menu-bg: #2d2d2d;
        --menu-text: #e0e0e0;
        --menu-hover: #3a3a3a;
        --menu-border: #444444;
        --toggle-color: #666666;
        --bar-color: #a0a0a0;
        --text-shadow: rgba(255, 255, 255, 0.1);
    }
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 100vh;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.list-container {
    max-width: 45ch;
    width: 33%;
    margin: 0;
    background-color: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px var(--shadow-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
    transition: border-color 0.3s ease;
}

li:last-child {
    border-bottom: none;
}

.highlight input {
    background-color: var(--highlight-bg);
    transition: background-color 0.3s ease;
}

.list {
    width: 100%;
    border: none;
    padding: 10px;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
    pointer-events: none;
    background-color: transparent;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.list.editable {
    pointer-events: auto;
}

.list:focus {
    outline: none;
    border-bottom: 2px solid var(--input-focus);
}

.add-note-container {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
    flex-wrap: wrap;
}

.add-note-input {
    flex: 1 1 auto;
    width: 62%;
    padding: 10px 10px;
    font-size: 16px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    box-sizing: border-box;
    min-width: 0;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.add-note-input:focus {
    outline: none;
    border: 1px solid var(--input-focus);
}

.add-note-button {
    flex: 1 1 auto; 
    padding: 10px 5px;
    font-size: 16px;
    cursor: pointer;
    background-color: var(--button-primary);
    color: white;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    min-width: 0;
}

.add-note-button:hover {
    background-color: var(--button-hover);
}

.textarea-container {
    margin: 0px;
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

textarea {
    width: 100%;
    height: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid transparent;
    box-shadow: 0 0 5px var(--shadow-color);
    border-radius: 4px;
    box-sizing: border-box;
    resize: none;
    flex: 1;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

textarea:focus {
    outline: none;
    border: 1px solid var(--input-border);
}

textarea:read-only:focus {
    border: none;
    text-shadow: 1px 1px 2px var(--text-shadow);
}

.toggle-button {
    height: 100%;
    width: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    color: var(--toggle-color);
    border: none;
    cursor: pointer;
    padding: 0px;
    transition: color 0.3s ease;
}

.list-container.collapsed {
    display: none;
}
