/* GLOBAL STYLES & RESET */
* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: "Press Start 2P", monospace, system-ui;
    font-weight: 400;
    text-align: center;
    font-style: normal;
    margin: 0;
    padding: 20px 15px;
    background: #7b5bb4;
    color: #03091f;
}

/* MAIN CARD CONTAINER */
#todocontainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
    padding: 25px 20px;
    border-radius: 12px;
    border: 4px solid #03091f;
    box-shadow: 6px 6px 0px #03091f, 0 10px 25px rgba(0, 0, 0, 0.3);
    background-image: linear-gradient(135deg, #f1c374, #e2888b);
}

/* HEADER */
#header h1 {
    font-size: 1.5rem;
    margin: 0 0 20px 0;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0px #ffffff;
    line-height: 1.4;
}

h2 {
    font-size: 1.1rem;
    margin: 25px 0 10px 0;
}

/* INPUT FORM SECTION */
#todocontainer > div:nth-child(2) {
    display: flex;
    width: 100%;
    gap: 8px;
    justify-content: center;
}

#inputBox {
    flex: 1;
    min-width: 0;
    padding: 12px 10px;
    border: 3px solid #03091f;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.75rem;
    background-color: #ffffff;
    color: #03091f;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#inputBox:focus {
    border-color: #454c68;
    box-shadow: 0 0 0 3px rgba(69, 76, 104, 0.3);
}

#inputButton {
    font-family: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 6px;
    border: 3px solid #03091f;
    background-color: #ffffff;
    color: #03091f;
    font-weight: bold;
    transition: transform 0.1s ease, background-color 0.2s, color 0.2s;
    box-shadow: 2px 2px 0px #03091f;
}

#inputButton:hover {
    background: #454c68;
    color: #ffffff;
}

#inputButton:active {
    transform: translate(2px, 2px);
    box-shadow: 0px 0px 0px #03091f;
}

/* TASK LIST */
ul {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
    width: 100%;
}

li {
    border: 3px solid #03091f;
    border-radius: 8px;
    margin: 10px 0;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    font-size: 0.7rem;
    line-height: 1.4;
    word-break: break-word;
    box-shadow: 3px 3px 0px #03091f;
    transition: transform 0.15s ease, background-color 0.2s;

}

li:hover {
    background-color: #ffffff;
}

/* CHECKBOX & SPAN LAYOUT */
li label {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    cursor: pointer;
    flex: 1;
}

li input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #454c68;
}

/* ACTION BUTTONS (EDIT / DELETE) */
.editBin, .deleteBin {
    margin-left: 6px;
    padding: 6px 8px;
    font-size: 0.6rem;
    cursor: pointer;
    border: 2px solid #03091f;
    border-radius: 4px;
    background-color: #ffffff;
    transition: background-color 0.2s, color 0.2s, transform 0.1s;
    user-select: none;
}

.editBin:hover {
    background-color: #f1c374;
}

.deleteBin:hover {
    background-color: #e2888b;
    color: #ffffff;
}

.editBin:active, .deleteBin:active {
    transform: scale(0.95);
}

/* COMPLETED STATE */
.completed {
    text-decoration: line-through;
    opacity: 0.6;
    /* background-color: rgba(230, 230, 230, 0.7); */
    border-color: #03091f;
}

/* COUNTER CONTAINER */
.counterContainer {
    margin-top: 20px;
    padding: 12px 18px;
    background-color: #03091f;
    color: #f1c374;
    border-radius: 8px;
    font-size: 0.65rem;
    line-height: 1.6;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#completedCounter, #uncompletedCounter {
    color: #ffffff;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 480px) {
    #header h1 {
        font-size: 1.1rem;
    }

    h2 {
        font-size: 0.9rem;
    }

    #todocontainer {
        padding: 18px 12px;
    }

    #todocontainer > div:nth-child(2) {
        flex-direction: column;
    }

    #inputBox, #inputButton {
        width: 100%;
        font-size: 0.7rem;
    }

    li {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }

    .editBin, .deleteBin {
        font-size: 0.55rem;
        padding: 5px 6px;
    }
    
    .counterContainer {
        font-size: 0.55rem;
        width: 100%;
        max-width: 350px;
    }
}