*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

:root {
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
}

.container{
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #153677, #4e085f);
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.todo-app{
    width: 100%;
    max-width: 600px;
    background: #fff;
    margin: 40px auto;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 15px;
}

.todo-app h2{
    color: var(--primary);
    display: flex;
    align-items: center;
    font-weight: 600;
}

.todo-app h2 img{
    width: 30px;
    margin-left: 10px;
}

.stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.85rem;
    color: var(--gray);
}

.stats span {
    margin-bottom: 3px;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

#search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    flex: 1;
    padding: 8px 15px;
    background: var(--light-gray);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.filter-btn.active {
    background: var(--primary);
    color: white;
}

.filter-btn:hover:not(.active) {
    background: #d3d3d3;
}

.row{
    display: flex;
    align-items: center;
    gap: 8px;
    background: #edeef0;
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

input, select {
    border: none;
    outline: none;
    background: transparent;
    padding: 10px;
    font-size: 14px;
    min-width: 0;
}

#input-box {
    flex: 2;
    min-width: 120px;
}

#category-select {
    flex: 1;
    min-width: 100px;
    cursor: pointer;
}

#due-date {
    flex: 1;
    min-width: 120px;
    cursor: pointer;
}

button{
    border: none;
    outline: none;
    padding: 10px 16px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

button:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
    display: none;
}

.empty-state i {
    font-size: 50px;
    margin-bottom: 15px;
    color: var(--light-gray);
}

.empty-state p {
    font-size: 16px;
}

ul {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

ul li{
    list-style: none;
    font-size: 16px;
    padding: 15px 15px 15px 60px;
    user-select: none;
    cursor: pointer;
    position: relative;
    border-bottom: 1px solid var(--light-gray);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    margin-bottom: 8px;
}

ul li:hover {
    background: #f9f9f9;
    transform: translateX(5px);
}

ul li::before{
    content: '';
    position: absolute;
    height: 24px;
    width: 24px;
    border-radius: 50%; 
    background-image: url(./images/unchecked.png);
    background-size: cover;
    background-position: center;
    top: 50%;
    transform: translateY(-50%);
    left: 15px;
}

ul li.checked{
    color: var(--gray);
    text-decoration: line-through;
    background: #f0f0f0;
}

ul li.checked::before{
    background-image: url(./images/checked.png);
}

.task-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.task-text {
    flex: 1;
}

.task-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--gray);
    margin-top: 5px;
}

.task-category {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.category-general {
    background: #e9ecef;
    color: #495057;
}

.category-work {
    background: #d0ebff;
    color: #1971c2;
}

.category-personal {
    background: #fff3bf;
    color: #e67700;
}

.category-shopping {
    background: #e3fafc;
    color: #0c8599;
}

.task-due {
    display: flex;
    align-items: center;
    gap: 3px;
}

.task-due.overdue {
    color: var(--danger);
    font-weight: 500;
}

ul li span{
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    height: 30px;
    width: 30px;
    font-size: 18px;
    color: var(--gray);
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    transition: all 0.3s;
}

ul li span:hover{
    background: var(--light-gray);
    color: var(--danger);
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.app-footer button {
    flex: 1;
    justify-content: center;
}

#clear-completed {
    background: var(--warning);
}

#clear-completed:hover {
    background: #e8590c;
}

#clear-all {
    background: var(--danger);
}

#clear-all:hover {
    background: #c2255c;
}

/* Responsive design */
@media (max-width: 768px) {
    .todo-app {
        padding: 20px 15px;
        margin: 20px auto;
    }
    
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .stats {
        align-items: flex-start;
    }
    
    .row {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    #input-box, #category-select, #due-date, button {
        width: 100%;
        min-width: auto;
    }
    
    .app-footer {
        flex-direction: column;
    }
    
    .filters {
        flex-wrap: wrap;
    }
    
    .filter-btn {
        min-width: calc(33.333% - 7px);
    }
}

@media (max-width: 480px) {
    .todo-app {
        padding: 15px 10px;
        margin: 10px auto;
    }
    
    .task-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .task-meta {
        flex-wrap: wrap;
    }
    
    .filter-btn {
        min-width: calc(50% - 5px);
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Scrollbar styling */
ul::-webkit-scrollbar {
    width: 6px;
}

ul::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

ul::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

ul::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Focus states for accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Loading animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

ul li {
    animation: fadeIn 0.3s ease-out;
}
