/* ===================================
   Global Reset
=================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===================================
   Page Styling
=================================== */
body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #c4b5fd, #bfdbfe, #fbcfe8);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #1f2937;
    padding: 20px;
}

/* ===================================
   Main App Container
=================================== */
.app-container {
    width: 100%;
    max-width: 760px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    padding: 35px;
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

/* ===================================
   Header
=================================== */
.app-header {
    text-align: center;
    margin-bottom: 30px;
}

.app-header h1 {
    font-size: 2.8rem;
    color: #4c1d95;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.subtitle {
    color: #6b7280;
    font-size: 1rem;
}

/* ===================================
   Input Section
=================================== */
.todo-input-section {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

#todo-input {
    flex: 1;
    padding: 15px 16px;
    border: 2px solid #ddd6fe;
    border-radius: 12px;
    font-size: 1rem;
    background-color: #f9fafb;
    transition: 0.3s ease;
    outline: none;
}

#todo-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

#add-btn {
    padding: 15px 22px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

#add-btn:hover {
    transform: translateY(-2px);
    opacity: 0.95;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.25);
}

/* ===================================
   Validation Message
=================================== */
#error-message {
    min-height: 24px;
    margin-bottom: 10px;
    color: #dc2626;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
}

/* ===================================
   Info Area
=================================== */
.todo-info {
    margin-bottom: 22px;
    font-size: 0.98rem;
    color: #4b5563;
    text-align: center;
}

.status-card {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #f5f3ff, #eff6ff);
    border: 1px solid #ddd6fe;
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.08);
}

.status-card p {
    font-weight: 700;
    color: #4338ca;
}

/* ===================================
   Task List
=================================== */
#todo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ===================================
   Individual Task Item
=================================== */
.todo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background 0.35s ease,
        border-color 0.35s ease,
        opacity 0.35s ease,
        filter 0.35s ease;
}

.todo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.08);
}

/* Left side of task */
.task-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

/* Checkbox styling */
.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #8b5cf6;
    flex-shrink: 0;
}

/* Task text */
.task-text {
    font-size: 1rem;
    line-height: 1.5;
    word-break: break-word;
    color: #1f2937;
    transition: color 0.35s ease, transform 0.35s ease;
}

/* Delete button */
.delete-btn {
    border: none;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.delete-btn:hover {
    transform: scale(1.05);
    opacity: 0.92;
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.25);
}

/* ===================================
   Completed Task Styling
=================================== */
.todo-item.completed {
    opacity: 0.9;
    background: linear-gradient(135deg, #ecfdf5, #bbf7d0);
    border-color: #4ade80;
    filter: saturate(1.05);
}

.todo-item.completed .task-text {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    color: #4b5563;
    transform: scale(0.99);
}

.todo-item.completed .delete-btn {
    background: linear-gradient(135deg, #10b981, #059669);
}

.todo-item.completed .delete-btn:hover {
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.25);
}

/* ===================================
   Task Animations
=================================== */
.todo-item.adding {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
}

.todo-item.removing {
    opacity: 0;
    transform: translateX(30px) scale(0.96);
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-color: #f87171;
}

/* ===================================
   Responsive Design
=================================== */
@media (max-width: 600px) {
    .app-container {
        padding: 24px;
    }

    .todo-input-section {
        flex-direction: column;
    }

    #add-btn {
        width: 100%;
    }

    .todo-item {
        flex-direction: column;
        align-items: stretch;
    }

    .delete-btn {
        width: 100%;
    }
}