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

body {
    background: #0b0e14;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: #151a24;
    width: 100%;
    max-width: 650px;
    padding: 32px;
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    border: 1px solid #262e3a;
}

h1 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 28px;
    letter-spacing: -0.3px;
}

/* Поле ввода */
.add-block {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.add-block input {
    flex: 1;
    padding: 16px 20px;
    background: #0f141c;
    border: 1.5px solid #262e3a;
    border-radius: 18px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
}

.add-block input:focus {
    border-color: #5d8bff;
    background: #0c1119;
}

.add-block input::placeholder {
    color: #5a6577;
}

.add-block button {
    padding: 0 28px;
    background: #5d8bff;
    color: white;
    border: none;
    border-radius: 18px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    letter-spacing: -0.2px;
}

.add-block button:hover {
    background: #6f98ff;
    transform: scale(1.02);
}

/* Список задач */
#todoList {
    list-style: none;
    margin-bottom: 24px;
}

.task-item {
    background: #0f141c;
    border: 1.5px solid #262e3a;
    border-radius: 18px;
    padding: 8px 16px 8px 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
}

.task-item:hover {
    border-color: #3a4555;
    background: #121823;
}

/* Кастомный чекбокс */
.checkbox-wrapper {
    position: relative;
    width: 26px;
    height: 26px;
    cursor: pointer;
}

.checkbox-wrapper input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    position: absolute;
    top: 0;
    left: 0;
    width: 26px;
    height: 26px;
    background: #0f141c;
    border: 2px solid #3a4555;
    border-radius: 9px;
    transition: all 0.15s;
}

.checkbox-wrapper:hover .checkbox-custom {
    border-color: #5d8bff;
    background: #1a212b;
}

.checkbox-wrapper input:checked + .checkbox-custom {
    background: #5d8bff;
    border-color: #5d8bff;
}

.checkbox-wrapper input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Текст задачи */
.task-text {
    flex: 1;
    color: #ffffff;
    font-size: 15px;
    line-height: 1.5;
    padding: 8px 0;
    transition: 0.2s;
    cursor: pointer;
}

.task-text.done {
    text-decoration: line-through;
    color: #5a6577;
}

/* Кнопки действий */
.task-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.task-item:hover .task-actions {
    opacity: 1;
}

.edit-btn, .delete-btn {
    background: none;
    border: none;
    color: #5a6577;
    font-size: 18px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.edit-btn:hover {
    background: #5d8bff;
    color: white;
    transform: scale(1.1);
}

.delete-btn:hover {
    background: #ff4d4f;
    color: white;
    transform: rotate(90deg);
}

/* Статистика */
#stats {
    background: #0f141c;
    border-radius: 18px;
    padding: 18px 20px;
    color: #9aa7b9;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1.5px solid #262e3a;
}

.progress-bar {
    width: 200px;
    height: 6px;
    background: #262e3a;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5d8bff, #8a6eff);
    border-radius: 10px;
    transition: width 0.3s;
}

.empty-message {
    text-align: center;
    color: #5a6577;
    padding: 40px 20px;
    font-size: 15px;
    background: #0f141c;
    border-radius: 18px;
    border: 1.5px dashed #262e3a;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #1e2632;
    padding: 32px;
    border-radius: 28px;
    width: 90%;
    max-width: 450px;
    border: 1px solid #3a4555;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal h3 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 20px;
}

.modal input {
    width: 100%;
    padding: 16px 20px;
    background: #0f141c;
    border: 1.5px solid #3a4555;
    border-radius: 18px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
    margin-bottom: 24px;
}

.modal input:focus {
    border-color: #5d8bff;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.save-btn, .cancel-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.save-btn {
    background: #5d8bff;
    color: white;
}

.save-btn:hover {
    background: #6f98ff;
    transform: scale(1.02);
}

.cancel-btn {
    background: #2a3340;
    color: #9aa7b9;
}

.cancel-btn:hover {
    background: #3a4555;
    color: white;
}