/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    /* Dark gradient */
    background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
    min-height: 100vh;
    color: #e5e7eb; /* slate-200 */
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header styles */
.app-header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.8s ease-out;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    color: rgba(255,255,255,0.9);
    font-weight: 300;
    font-size: 1.1rem;
}

/* Input section */
.input-section {
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    background: #0f172a;
    border-radius: 25px;
    padding: 0.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.input-group:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

#taskInput {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    color: #e5e7eb;
}

#taskInput::placeholder {
    color: #9ca3af;
}

/* New: due date input styling */
#dueDateInput {
    border: 1px solid #374151;
    background: #1f2937;
    padding: 0.5rem 0.75rem;
    border-radius: 14px;
    color: #e5e7eb;
}

.add-btn {
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.add-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.add-btn:active {
    transform: scale(0.95);
}

/* Filter section */
.filter-section {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.filter-btn {
    background: rgba(124, 58, 237, 0.18);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: #e5e7eb;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    border-color: transparent;
    color: white;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* Stats section */
.stats-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    color: #9ca3af;
    font-size: 0.9rem;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

/* Tasks container */
.tasks-container {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    background: #0f172a;
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    cursor: grab;
    animation: slideInRight 0.4s ease-out;
    border-left: 4px solid #7c3aed;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.task-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    cursor: grabbing;
}

.task-item.completed {
    border-left-color: #10b981; /* emerald */
    opacity: 0.8;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: #888;
}

.task-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #4b5563;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.task-checkbox:hover {
    border-color: #a78bfa;
    transform: scale(1.1);
}

.task-checkbox.checked {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: #16a34a;
}

.task-checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.task-text {
    flex: 1;
    font-size: 1rem;
    color: #e5e7eb;
    transition: color 0.2s ease;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-item:hover .task-actions {
    opacity: 1;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: #666;
}

.action-btn:hover {
    background: rgba(255,255,255,0.06);
    color: #e5e7eb;
    transform: scale(1.1);
}

.edit-btn:hover {
    color: #2563eb; /* blue-600 */
}

.delete-btn:hover {
    color: #ef4444; /* red-500 */
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
    animation: fadeIn 1s ease-out 1s both;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.empty-state p {
    font-size: 1rem;
    opacity: 0.8;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .app-header h1 {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
        border-radius: 15px;
    }
    
    .add-btn {
        width: 100%;
        border-radius: 10px;
        height: 45px;
    }
    
    .filter-section {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }
    
    .stats-section {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .task-item {
        padding: 0.75rem;
    }
    
    .task-content {
        gap: 0.75rem;
    }
    
    .task-actions {
        opacity: 1;
        position: static;
    }
}

/* Drag and drop visual feedback */
.task-item.drag-over {
    border-left-width: 8px;
    transform: scale(1.02);
}

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.2s ease;
}

/* New: Due date badge */
.task-due {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.06);
    color: #e5e7eb;
}
.task-due.overdue { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.task-due.due-soon { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
.task-due.on-time { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; }

/* New: time filter selects */
.time-filter {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 0 0 1.25rem 0;
}
.time-filter select {
    background: #0f172a;
    border: 1px solid #374151;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    color: #e5e7eb;
}
