* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #f1f3f6;
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    max-width: 750px;
    margin: auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

/* Header */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.header h1 {
    font-size: 28px;
}

#themeBtn {
    border: none;
    background: #eee;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
}

/* Search */

#searchInput {
    width: 100%;
    padding: 13px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 15px;
}

/* Task Form */

.task-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 8px;
}

.task-form input,
.task-form select {
    padding: 11px;
    border: 1px solid #ddd;
    border-radius: 7px;
}

#addBtn {
    background: #222;
    color: white;
    border: none;
    padding: 11px 15px;
    border-radius: 7px;
    cursor: pointer;
}

#addBtn:hover {
    opacity: 0.8;
}

/* Filters */

.filters {
    display: flex;
    gap: 10px;
    margin: 25px 0 15px;
}

.filter {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

.filter.active {
    background: #222;
    color: white;
}

/* Task */

.task {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7f7f7;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.task-info {
    flex: 1;
}

.task-title {
    font-size: 17px;
    font-weight: bold;
}

.task.completed .task-title {
    text-decoration: line-through;
    opacity: 0.5;
}

.task-details {
    margin-top: 7px;
    font-size: 13px;
    color: #666;
}

.task-actions {
    display: flex;
    gap: 5px;
}

.task-actions button {
    border: none;
    padding: 7px 9px;
    border-radius: 6px;
    cursor: pointer;
}

.complete-btn {
    background: #d9f7df;
}

.edit-btn {
    background: #fff0c2;
}

.delete-btn {
    background: #ffd8d8;
}

/* Statistics */

.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    text-align: center;
}

.stats h3 {
    font-size: 24px;
}

.stats p {
    color: #777;
    margin-top: 4px;
}

/* Progress */

.progress-section {
    margin-top: 25px;
}

.progress-section p {
    margin-bottom: 8px;
}

.progress-bar {
    height: 12px;
    background: #ddd;
    border-radius: 10px;
    overflow: hidden;
}

#progress {
    height: 100%;
    width: 0%;
    background: #222;
    transition: 0.3s;
}

/* Dark Mode */

body.dark {
    background: #181818;
}

body.dark .container {
    background: #242424;
    color: white;
}

body.dark .task {
    background: #333;
}

body.dark #searchInput,
body.dark .task-form input,
body.dark .task-form select {
    background: #333;
    color: white;
    border-color: #555;
}

body.dark #themeBtn {
    background: #444;
    color: white;
}

/* Mobile */

@media (max-width: 650px) {

    .task-form {
        grid-template-columns: 1fr;
    }

    .task {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .task-actions {
        width: 100%;
    }

    .task-actions button {
        flex: 1;
    }

    .header h1 {
        font-size: 22px;
    }
}