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

/*========BODY=========*/
body{
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: rgb(255, 255, 255);
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

/*=======CARD==========*/
.app{
    background: white;
    width: 100%;
    max-width: 500px;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(12, 107, 196, 0.5);
}

/*=========TITLE=========*/
.app h1{
    font-size: 28px;
    font-weight: 600; 
    text-align: center;
    margin-bottom: 20px;
}

.subtitle{
    text-align: center;
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 20px;
}

/*========INPUT========*/
.input-group{
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#todo-input{
    flex: 1;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
}

#todo-input:focus{
    border-color: #1a11d0;
    box-shadow: 0 0 0 2px rgba(12, 85, 196, 0.2);
}

button{
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

#add-btn{
    padding: 10px 15px;
    background: #4f46e5;
    border-radius: 8px;
    color: white;
}

#add-btn:hover{
    background: #4338ca;
}

/*========FILTERS========*/
.filters{
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.filters button{
    flex: 1;
    padding: 8px;
    font-size: 14px;
    background: #e5e7eb;
    border-radius: 6px;
}

/* ===== BUTTON CLEAR ALL =====*/
.actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

#clear-all{
    margin-top: 5px;
    padding: 8px 12px;
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#clear-all:hover{
    background: #e60000;
}

/* ========== LIST ========== */
#todo-list {
    list-style: none;
}

#todo-list input{
    transform: scale(1.2);
    cursor: pointer;
}

#todo-list li{
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9fafb; 
    padding: 8px 10px;
    margin-top: 6px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;

    transition: all 0.2s ease; /* drag item */
}

#todo-list span{
    flex: 1;
    margin-left: 8px;
    word-break: break-word; 
    margin-right: 10px;
    cursor: pointer;
}

#todo-list li:hover{
    background: #f3f4f6; 
}

/* tombol delete */
#todo-list button{
    background: #ef4444;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0; 
}

#todo-list button{
    background: #ef4444;
}

#todo-list button:hover{
    background: #dc2626;
}

.fade-out {
    opacity: 0;
    transform: translateX(30px) scale(0.95);
    transition: all 0.2 ease-in-out;
}

/* coret tulisan saat centang */
.done {
    text-decoration: line-through;
    color: #9ca3af;
    opacity: 0.7;
}

/* filter button */
button.active{
    background: #4f46e5;
    color: white;
}

#task-count {
    font-size: 13px;
    margin-top: 10px;
    color: #9ca3af;
}
#task-count{
    text-align: center;
    margin-top: 10px;
    color: #9ca3af;
    font-size: 13px;
}

/* ANIMASI BUTTON DI TEKAN */
button:active {
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

button {
    transition: transform 0.1s ease; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

button:hover {
    opacity: 0.9;
}

/* HIGHLIGHT SAAT EDIT */
input[type="text"]{
    outline: 1px solid #4f46e5;
}

/* Responsive */
@media (max-width: 500px) {
    .app {
        padding: 20px 15px;
    }

    .input-group {
        flex-direction: column;
    }

    #add-btn {
        width: 100%;
    }

    .filters {
        flex-direction: column;
    }

    .filters button {
        width: 100%;
    }

    .actions {
        justify-content: center;
    }

    #clear-all {
        width: 100%;
    }
}