/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 1rem;
    color: #333;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #666;
    font-size: 0.95rem;
}

/* Task form */
.task-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.task-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.task-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Task list */
.tasks-container {
    min-height: 200px;
}

.task-list {
    list-style: none;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

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

.task-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

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

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

/* Task text */
.task-text {
    flex: 1;
    font-size: 1rem;
    color: #333;
    word-break: break-word;
}

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

/* Delete button */
.btn-delete {
    background: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #c82333;
    transform: scale(1.05);
}

.btn-delete:active {
    transform: scale(0.95);
}

/* Empty state */
.empty-state {
    text-align: center;
    color: #999;
    padding: 3rem 1rem;
    font-style: italic;
}

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

/* Responsive design */
@media (max-width: 640px) {
    .container {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

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

    .btn-primary {
        width: 100%;
    }

    .task-item {
        padding: 0.875rem;
    }
}

@media (max-width: 400px) {
    body {
        padding: 0.5rem;
    }

    .container {
        padding: 1rem;
        border-radius: 12px;
    }
}
