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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Форма добавления задачи */
.add-task-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#taskInput {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#taskInput:focus {
    outline: none;
    border-color: #667eea;
}

#addTaskBtn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#addTaskBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#addTaskBtn:active {
    transform: translateY(0);
}

/* Счетчик задач */
.task-stats {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

/* Список задач */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: slideIn 0.3s ease-out;
}

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

.task-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: #999;
}

/* Checkbox */
.task-checkbox {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    cursor: pointer;
    accent-color: #667eea;
}

/* Текст задачи */
.task-title {
    flex: 1;
    font-size: 16px;
    color: #333;
    word-break: break-word;
}

/* Дата создания */
.task-date {
    font-size: 12px;
    color: #999;
    margin-right: 15px;
}

/* Кнопка удаления */
.delete-btn {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.delete-btn:hover {
    background: #ff3838;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 18px;
}

.empty-state.hidden {
    display: none;
}

/* Loader */
.loader {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.loader.hidden {
    display: none;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Адаптивность */
@media (max-width: 640px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .add-task-form {
        flex-direction: column;
    }

    #addTaskBtn {
        width: 100%;
    }

    .task-item {
        flex-wrap: wrap;
    }

    .task-date {
        width: 100%;
        margin-top: 5px;
        margin-left: 39px;
    }
}
