/* --- General --- */
body {
    font-family: 'Trebuchet MS', sans-serif;
    background-color: lightslategray;
    margin: 0;
    padding: 20px;
}

h1, h2 {
    text-align: center;
    color: black;
}

/* --- Input Form --- */
.input-container {
    display: flex;
    justify-content: center;
    align-items: center;  
    gap: 10px;  
    margin-bottom: 20px;
}

#input-todo, #due-date, #priority {
    padding: 6px 8px;
    font-size: 1.2rem;
    border-radius: 5px;
    border: 1px solid #ccc;
}

#input-todo {
    width: 250px;
}

#add-todo {
    height: 30px;
    width: 40px;
    border-radius: 20px;
    border: none;
    background-color: lightgreen;
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- Todo Container --- */
.todo-container {
    width: 80vw;
    max-width: 800px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- Each Todo Item --- */
/* --- Todo Item Layout --- */
.todo {
    background-color: lightsteelblue;
    display: flex;
    justify-content: space-between; /* task info left, actions right */
    align-items: flex-start;        /* align text at top */
    border-radius: 10px;
    padding: 6px 10px;             /* reduced padding */
    gap: 3px;                       /* smaller gap */
    flex-wrap: wrap;                /* allow text to wrap if needed */
}

/* Container for task info */
.todo-info {
    display: flex;
    flex-direction: column;  /* stack name, due date, priority vertically */
    gap: 4px;                /* reduced gap */
}

/* Actions container */
.actions {
    display: flex;
    flex-direction: column;
    gap: 5px;                 /* smaller gap */
    align-items: flex-end;    /* keep delete button and checkbox aligned right */
}

/* Completed task */
.checked-task {
    text-decoration: line-through;
    color: gray;
    opacity: 0.7;
}

/* Overdue task */
.todo.overdue {
    border-left: 6px solid red;   /* slightly thinner border */
    background-color: #ffe6e6;
}

/* Due date and priority text */
.due-date, .priority-text {
    font-size: 0.85rem;   /* slightly smaller font */
    margin: 0;            /* remove extra margin */
}


.priority-high { color: red; font-weight: bold; }
.priority-medium { color: darkviolet; }
.priority-low { color: green; }

/* Actions */
.actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.actions > form > button {
    background-color: red;
    color: white;
    border: none;
    padding: 5px 8px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 8px;
}

/* Completed & Overdue */
.checked-task {
    text-decoration: line-through;
    color: gray;
    opacity: 0.7;
}

.todo.overdue {
    border-left: 8px solid red;
    background-color: #ffe6e6;
}

/* --- Mobile Responsive --- */
@media (max-width: 600px) {
    .input-container {
        flex-direction: column;
        align-items: stretch;
    }

    #input-todo, #due-date, #priority, #add-todo {
        width: 100%;
        font-size: 1rem;
    }

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

    .actions {
        flex-direction: row;
        margin-top: 10px;
    }

    .todo-container {
        width: 100%;
        gap: 12px;
    }
}

/* --- Login/Register form styling --- */
.auth-container {
    width: 350px;             /* Width of the form box */
    max-width: 90%;           /* Works on small screens */
    margin: 80px auto;        /* Center horizontally & vertical spacing */
    padding: 30px;
    background-color: #f2f2f2;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.auth-container input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.auth-container button {
    width: 100%;
    padding: 10px;
    font-size: 1.1rem;
    border-radius: 6px;
    border: none;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
}

.auth-container button:hover {
    background-color: #45a049;
}
