/* Общий стиль */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    transition: background 0.5s ease-in-out;
}

body.dark-mode {
    background: linear-gradient(135deg, #2e2e2e, #1c1c1c);
    color: #f5f5f5;
}

/* Контейнер */
.container {
    background: var(--container-bg, #fff);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 100%;
    max-width: 450px;
    color: var(--container-text, #333);
    transition: background 0.3s ease, color 0.3s ease;
}

body.light-mode {
    --container-bg: #fff;
    --container-text: #333;
}

body.dark-mode {
    --container-bg: #2e2e2e;
    --container-text: #f5f5f5;
}

/* Заголовок */
h1 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: var(--title-color, #5c67f2);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Тема */
#theme-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 34px;
    transition: 0.4s;
}

.slider::before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
}

input:checked + .slider {
    background-color: #5c67f2;
}

input:checked + .slider::before {
    transform: translateX(20px);
}

/* Поле ввода */
#task-input {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--input-border, #ddd);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--input-bg, #fff);
    color: var(--input-text, #333);
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode #task-input {
    --input-bg: #3a3a3a;
    --input-text: #fff;
    --input-border: #555;
}

/* Кнопки */
button {
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.btn.primary {
    background: #5c67f2;
    color: white;
}

button.delete {
    background: #f44336;
    color: white;
}

button.complete {
    background: #4caf50;
    color: white;
}

/* Контейнер для кнопок действий (✓ и ✗) */
li div {
    display: flex;
    gap: 10px; /* Увеличиваем расстояние между кнопками */
}

/* Фильтры */
.filter {
    background: #e3e3e3;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 15px 5px 0;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.filter.active {
    background: #5c67f2;
    color: #fff;
}

.filter:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Список задач */
ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

li {
    background: var(--task-bg, #f9f9f9);
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease, transform 0.3s ease;
}

body.dark-mode li {
    --task-bg: #3a3a3a;
}

li:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.task-completed {
    text-decoration: line-through;
    color: #999;
    transition: color 0.3s ease;
}

/* История задач */
#history-list {
    padding: 0;
    margin-top: 10px;
    text-align: left;
}

#history-list li {
    background: #f0f0f0;
    padding: 8px;
    border-radius: 5px;
    margin-bottom: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease, color 0.3s ease;
}

#history-list.dark-history li {
    background: #333;
    color: #fff;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
}