/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", sans-serif;
}

/* BODY */
body {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #eaf1ff, #d6e4ff);
    background-: cover;
    background-position: center;
}

.main {
    min-height: calc(100vh - 140px); /* header + footer height */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}


/* HEADER */
.header {
    width: 100%;
    padding: 15px;
    background: #1f3c88;
    color: white;
    text-align: center;
    position: relative;
}

#darkToggle {
    position: absolute;
    right: 20px;
    top: 15px;
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

/* APP CARD */
.app {
    background: white;
    width: 450px;
    max-width: 95%;
    margin: 30px 0;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: fadeIn 0.6s ease;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}



@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    text-align: center;
}

h3 {
    text-align: center;
}

.tagline {
    text-align: center;
    font-size: 13px;
    color: #777;
    margin-bottom: 10px;
}

/* COUNTER */
.counter {
    text-align: center;
    font-size: 13px;
    margin-bottom: 10px;
    color: #444;
}

/* INPUTS */
#search, .add-task input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-bottom: 10px;
}

.add-task {
    display: flex;
    gap: 8px;
}

.add-task button {
    background: #5a95ff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
}

/* TASK LIST */
ul {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

li {
    background: #f6f8ff;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

li:hover {
    transform: scale(1.02);
}

.checkbox {
    width: 18px;
    height: 18px;
}

.task-text {
    flex: 1;
}

.completed .task-text {
    text-decoration: line-through;
    opacity: 0.6;
}

.due {
    font-size: 12px;
}

.delete {
    color: red;
    cursor: pointer;
}

/* FOOTER */
.footer {
    width: 100%;
    text-align: center;
    background: #1b2a4e;
    color: #e0e6f0;
    padding: 10px;
    font-size: 12px;
}

/* DARK MODE */
body.dark {
    background: #121212;
}

body.dark .app {
    background: #1e1e1e;
    color: white;
}

body.dark input,
body.dark button {
    background: #333;
    color: white;
    border-color: #444;
}

body.dark li {
    background: #2a2a2a;
}

/* MOBILE */
@media (max-width: 480px) {
    .app {
        width: 100%;
        padding: 20px;
    }

    .add-task {
        flex-direction: column;
    }

    #darkToggle {
        right: 10px;
        top: 10px;
    }
}
