/* ========= RESET ========= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, sans-serif;
}

body {
    background: #f4f6f8;
    color: #333;
}

/* ========= LAYOUT ========= */

.header {
    background: #ffdddd;
    color: #000000;
    padding: 20px;
    border-radius: 10px;
    margin: 20px auto;
    max-width: 900px;
}

.container {
    max-width: 900px;
    margin: auto;
    padding: 10px;
}

/* ========= INPUT ACTIONS ========= */

input[type="button"],
input[type="submit"] {
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.primary-input {
    background: #0d6efd;
    color: #fff;
}

.primary-input:hover {
    background: #0b5ed7;
}

.danger-input {
    background: #dc3545;
    color: #fff;
}

.neutral-input {
    background: #e0e0e0;
    color: #333;
}

/* ========= SEARCH & FILTER ========= */

.controls {
    background: #ffffff;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.controls input[type="text"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: #f0f0f0;
}

.filter-btn.active {
    background: #0d6efd;
    color: #fff;
}

/* ========= TASK CARD ========= */

.task-list {
    margin-top: 15px;
}

.task-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    border-left: 6px solid transparent;
}

/* Priority border */
.high-border {
    border-left-color: #dc3545;
}

.low-border {
    border-left-color: #198754;
}

/* Completed task */
.task-card.completed {
    opacity: 0.7;
}

/* Strike-through effect */
.task-card.completed .task-title,
.task-card.completed .task-desc {
    text-decoration: line-through;
}

/* ========= TASK CONTENT ========= */

.task-title {
    font-weight: 600;
}

.task-desc {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

/* Priority badge */
.priority-badge {
    margin-top: 6px;
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: #fff;
}

.priority-badge.high {
    background: #dc3545;
}

.priority-badge.low {
    background: #198754;
}

/* ========= TASK ACTIONS ========= */

.task-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ========= MODALS ========= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.modal-hidden {
    display: none;
}

.modal-box {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.modal-box input,
.modal-box textarea,
.modal-box select {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

/* Fix mobile select overflow */
.modal-box select {
    width: 100%;
    max-width: 100%;
    appearance: none;
    font-size: 16px;
}

/* Modal actions */
.modal-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ========= STATS ========= */

.stats {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    background: #ffffff;
    padding: 15px;
    border-radius: 10px;
}

.stat-box {
    text-align: center;
}

.stat-box h2 {
    color: #0d6efd;
}

/* ========= RESPONSIVE ========= */

@media (max-width: 600px) {
    .task-card {
        flex-direction: column;
    }

    .task-actions {
        flex-direction: row;
        justify-content: flex-end;
    }

    .stats {
        flex-direction: column;
        gap: 10px;
    }

    .modal-box {
        max-height: 90vh;
        overflow-y: auto;
    }
}