/* 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;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Task input section */
.task-input-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.task-input-section:hover {
    transform: translateY(-2px);
}

.input-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

#taskInput {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

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

#taskInput::placeholder {
    color: #a0aec0;
}

#addButton {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

#addButton:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

#addButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.input-hint {
    font-size: 0.875rem;
    color: #718096;
    text-align: center;
}

/* Task list section */
.task-list-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.list-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

.task-stats {
    font-size: 0.875rem;
    color: #718096;
}

.task-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

/* Task items */
.task-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease;
}

.task-item:hover {
    border-color: #e2e8f0;
    transform: translateX(4px);
}

.task-item.completed {
    opacity: 0.7;
    background: #edf2f7;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 1rem;
    cursor: pointer;
    accent-color: #667eea;
}

.task-text {
    flex: 1;
    font-size: 1rem;
    color: #2d3748;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

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

.task-remove {
    padding: 0.5rem;
    background: #fc8181;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
}

.task-remove:hover {
    background: #f56565;
    transform: scale(1.05);
}

.task-remove:active {
    transform: scale(0.95);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #a0aec0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
}

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

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

.task-item.removing {
    animation: fadeOut 0.3s ease forwards;
}

/* Responsive design */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .input-container {
        flex-direction: column;
    }
    
    #addButton {
        justify-content: center;
    }
    
    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Focus styles for accessibility */
.task-item:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

#taskInput:focus,
#addButton:focus,
.task-checkbox:focus,
.task-remove:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
