@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400..700&display=swap');

:root {
    --primary: #6366f1;
    --accent: #f43f5e;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --font-main: 'Inter', sans-serif;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--bg-light);
    font-family: var(--font-main);
    margin: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

.todo-app {
    width: 100%;
    max-width: 500px;
    background: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

.todo-app__header {
    display: grid;
    grid-template-columns: auto 1fr auto; 
    align-items: center;
    padding: 1rem;
    background: white;
    box-shadow: var(--shadow);
    z-index: 10;
}

.todo-app__title {
    font-size: 1.25rem;
    margin: 0;
    color: #1e293b;
    text-align: center;
    font-weight: 700;
}

.todo-input {
    display: flex;
    padding: 20px;
    gap: 10px;
}

.todo-input__field {
    flex-grow: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    outline: none;
}

.todo-input__add-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    width: 48px;
    height: 48px;
    cursor: pointer;
    font-size: 1.2rem;
}

.task-list {
    list-style: none;
    padding: 0 20px;
}

.task-list__item {
    background: white;
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    padding: 12px;
    border: 1px solid #edf2f7;
}

.task-list__main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.task-list__text {
    flex-grow: 1;
    color: #1e293b;
}

.task-list__text--done {
    text-decoration: line-through;
    opacity: 0.5;
}

.task-list__main button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    opacity: 0.7;
    transition: 0.2s;
}

.task-list__main button:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Стили для Мемо */
.task-list__memo {
    display: none;
    padding: 12px;
    margin-top: 10px;
    background-color: #f1f5f9;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.task-list__memo--active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.task-list__memo-content {
    min-height: 40px;
    margin-bottom: 10px;
    outline: none;
}

.task-list__memo-save {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Подсветка кнопки Мемо если есть текст */
.task-list__btn--memo.has-content {
    background-color: #fbbf24 !important;
    border-radius: 8px;
    opacity: 1 !important;
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.4);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ТЕМНАЯ ТЕМА */
body.dark-theme {
    background-color: #0f172a;
}

body.dark-theme .todo-app,
body.dark-theme .todo-app__header {
    background-color: #1e293b;
}

body.dark-theme .todo-app__title {
    color: #ffffff;
}

body.dark-theme .task-list__item {
    background-color: #334155;
    border-color: #475569;
}

body.dark-theme .task-list__text,
body.dark-theme .todo-app__theme-btn,
body.dark-theme .todo-app__menu-btn {
    /* color: #f1f5f9; */
    /* color: #ffffff  */
    color: var(--bg-dark) !important; /* Делаем иконки читаемыми на темном фоне */
    opacity: 1;
}

body.dark-theme .task-list__memo {
    background-color: #1e293b;
    color: #cbd5e1;
}

body.dark-theme .todo-input__field {
    background-color: #334155;
    border-color: #475569;
    color: white;
}

/* Сайд-меню и модалки */
.side-menu {
    position: absolute;
    top: 0; left: 0; width: 250px; height: 100%;
    background: #1e293b; color: white;
    z-index: 100; padding: 20px;
    transition: transform 0.3s ease;
}
.side-menu--hidden { transform: translateX(-100%); }
.side-menu__nav { display: flex; flex-direction: column; gap: 10px; margin-top: 40px; }
.side-menu__nav button {
    background: rgba(255,255,255,0.05);
    border: 1px solid #475569; color: white;
    padding: 10px; border-radius: 8px; cursor: pointer;
}
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); display: flex; justify-content: center; align-items: center; z-index: 1000;
}
.modal--hidden { display: none; }
.modal__content { background: #1e293b; color: white; padding: 30px; border-radius: 12px; text-align: center; }