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

/* =========
   Base
   ========= */
body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top, #1abc9c, #3498db 40%, #2c3e50 80%);
    font-family: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #ecf0f1;
    padding: 20px;
}

/* App container */
.app {
    width: 100%;
    max-width: 520px;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 20px;
}

.app-title {
    font-family: "Montserrat", sans-serif;
    font-size: 2.5rem;
    letter-spacing: 0.04em;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.app-subtitle {
    font-size: 0.95rem;
    opacity: 0.85;
}

/* Card */
.todo-card {
    background: rgba(44, 62, 80, 0.9);
    border-radius: 18px;
    padding: 20px 22px 18px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Input row */
.todo-form {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.todo-form input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.8);
    color: #ecf0f1;
    padding: 10px 14px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.todo-form input::placeholder {
    color: rgba(236, 240, 241, 0.7);
}

.todo-form input:focus {
    border-color: #1abc9c;
    box-shadow: 0 0 0 1px rgba(26, 188, 156, 0.7);
}

.todo-form button {
    border-radius: 999px;
    border: none;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: "Montserrat", sans-serif;
    cursor: pointer;
    background: linear-gradient(135deg, #1abc9c, #3498db);
    color: #ecf0f1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 10px 25px rgba(22, 160, 133, 0.6);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.todo-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 35px rgba(22, 160, 133, 0.8);
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
}

.filters {
    display: flex;
    gap: 6px;
}

.filter-btn {
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    background: rgba(52, 73, 94, 0.9);
    color: #ecf0f1;
    transition: background 0.2s ease, transform 0.15s ease;
}

.filter-btn:hover {
    background: rgba(46, 204, 113, 0.4);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: rgba(46, 204, 113, 0.9);
}

/* Secondary button */
.secondary-btn {
    border-radius: 999px;
    border: none;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    background: rgba(192, 57, 43, 0.1);
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.4);
    transition: background 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
}

.secondary-btn:hover {
    background: rgba(192, 57, 43, 0.3);
    transform: translateY(-1px);
}

/* Task list */
.task-list {
    list-style: none;
    margin-bottom: 10px;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Scrollbar styling */
.task-list::-webkit-scrollbar {
    width: 6px;
}
.task-list::-webkit-scrollbar-track {
    background: transparent;
}
.task-list::-webkit-scrollbar-thumb {
    background: rgba(149, 165, 166, 0.7);
    border-radius: 999px;
}

/* Task item */
.task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(44, 62, 80, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 6px;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.task-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}

.task-item.completed {
    opacity: 0.6;
    background: rgba(44, 62, 80, 0.6);
}

.task-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Task text */
.task-text {
    flex: 1;
    font-size: 0.95rem;
    word-break: break-word;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: rgba(189, 195, 199, 0.9);
}

/* Delete button */
.delete-btn {
    border: none;
    background: transparent;
    color: #e74c3c;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 4px;
    transition: transform 0.1s ease, color 0.2s ease;
}

.delete-btn:hover {
    transform: scale(1.1);
    color: #ff6b5a;
}

/* Footer */
.todo-footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.8rem;
    margin-top: 4px;
    color: rgba(236, 240, 241, 0.8);
}

#task-count {
    font-weight: 600;
}

.hint {
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 480px) {
    .todo-card {
        padding: 16px;
    }

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

    .secondary-btn {
        align-self: flex-end;
    }
}
