/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 16px;
}

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    padding: 24px;
}

/* ===== HEADER ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: #4a90d9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

.stats {
    font-size: 0.8rem;
    color: #888;
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 4px 10px;
    border-radius: 20px;
}

/* ===== PROGRESS ===== */
.progress-section {
    margin-bottom: 16px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 14px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #666;
    margin-bottom: 6px;
}

.progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #4a90d9;
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* ===== INPUT SECTION ===== */
.input-section {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 10px;
    font-size: 1rem;
    color: #aaa;
    pointer-events: none;
}

input#taskInput {
    width: 100%;
    padding: 10px 10px 10px 32px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: Arial, sans-serif;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
}

input#taskInput::placeholder {
    color: #bbb;
}

input#taskInput:focus {
    border-color: #4a90d9;
}

#addTask {
    padding: 10px 18px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

#addTask:hover {
    background: #357abd;
}

/* ===== FILTER TABS ===== */
.filter-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.tab {
    padding: 6px 14px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.82rem;
    color: #666;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.tab:hover {
    background: #e8e8e8;
    color: #333;
}

.tab.active {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
}

/* ===== TASK LIST ===== */
.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== TASK ITEM ===== */
.task-item {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}

.task-item:hover {
    background: #f0f0f0;
}

/* Checkbox */
.task-check {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
}

.task-check:hover {
    border-color: #4a90d9;
}

.task-check.checked {
    background: #4a90d9;
    border-color: #4a90d9;
}

.task-check.checked::after {
    content: '';
    width: 4px;
    height: 8px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

/* Task text */
.task-text {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
    word-break: break-word;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: #aaa;
}

/* Delete button */
.task-buttons {
    display: flex;
    gap: 4px;
}

.task-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.delete-btn {
    background: #ffe5e5;
    color: #e53e3e;
}

.delete-btn:hover {
    background: #e53e3e;
    color: #fff;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.empty-state.visible {
    display: block;
}

.empty-icon {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

.empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.empty-sub {
    font-size: 0.82rem;
    color: #999;
}

/* ===== FOOTER ===== */
.footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.8rem;
    color: #888;
}

.clear-btn {
    background: #fff;
    border: 1px solid #e53e3e;
    color: #e53e3e;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.2s;
}

.clear-btn:hover {
    background: #e53e3e;
    color: #fff;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #333;
    color: #fff;
    padding: 8px 18px;
    border-radius: 4px;
    font-size: 0.82rem;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 100;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    body { padding: 20px 12px; }

    .input-section { flex-direction: column; }

    #addTask { width: 100%; }
}