:root {
    --primary-color: #0f172a;
    --secondary-color: #111827;
    --text-color: #e5e7eb;
    --completed-color: #6b7280;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --neon-white: #ffffff;
    --shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: radial-gradient(circle at top, #0a0f1f, #020617);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text-color);
}

.container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    border-radius: 16px;
    box-shadow:
        0 0 20px rgba(0,0,0,0.5),
        0 0 40px rgba(0,240,255,0.1);
}

header {
    text-align: center;
    margin-bottom: 1.5rem;
}

h1 {
    color: #fff;
    margin-bottom: 1rem;
}

.stats {
    display: flex;
    justify-content: space-around;
    font-size: 0.9rem;
    color: #666;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

input[type="text"] {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
}

button {
    background-color: #000;
    color: #fff;
    border: 1px solid #fff;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

button:hover {
    box-shadow:
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #fff,
        0 0 40px #fff;
    transform: scale(1.05);
}

button#add-btn {
    background-color: transparent;
    border: 1px solid #fff;
    color: #fff;
}

button#add-btn:hover {
    box-shadow: 0 0 10px #fff;
    background-color: rgba(255,255,255,0.05);
}

.filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

ul {
    list-style: none;
}

/* ─── Item da lista ────────────────────────────────────────────────────── */
li {
    position: relative;
    overflow: hidden;

    --x: 50%;
    --y: 50%;

    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.25s ease;
    margin-bottom: 8px;
}

/* ─── Animação de entrada ───────────────────────────────────────────────── */
li.task-enter {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
}

li.task-enter-active {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* ─── Animação de saída ─────────────────────────────────────────────────── */
li.task-leave {
    opacity: 0;
    transform: translateX(30px) scale(0.95);
    pointer-events: none;
}

/* ─── Drag and Drop ─────────────────────────────────────────────────────── */
li.dragging {
    opacity: 0.4;
    cursor: grabbing;
}

li.drag-over {
    border-color: rgba(0, 240, 255, 0.8);
    box-shadow:
        0 0 12px rgba(0,240,255,0.5),
        inset 0 0 8px rgba(0,240,255,0.2);
}

/* ─── Luz que segue o mouse ─────────────────────────────────────────────── */
li::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;

    background: radial-gradient(
        250px circle at var(--x) var(--y),
        rgba(0,240,255,0.7),
        rgba(0,240,255,0.3),
        transparent 70%
    );

    opacity: 1;
    transition: opacity 0.2s, background 0.05s;
    z-index: 0;
    pointer-events: none;
}

/* ─── Brilho do vidro ───────────────────────────────────────────────────── */
li::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;

    background: linear-gradient(
        120deg,
        transparent,
        rgba(255,255,255,0.4),
        transparent
    );

    transform: skewX(-25deg);
    transition: 0.5s;
    z-index: 1;
    pointer-events: none;
}

li:hover::before {
    left: 120%;
}

li * {
    position: relative;
    z-index: 2;
}

li:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 0 20px #00f0ff,
        0 0 40px rgba(0,240,255,0.6),
        0 0 80px rgba(0,240,255,0.4);
}

/* ─── Texto e estado concluído ──────────────────────────────────────────── */
.task-text {
    flex: 1;
    cursor: pointer;
    margin-right: 10px;
    user-select: none;
}

.task-text:hover {
    opacity: 0.85;
}

li.completed .task-text {
    text-decoration: line-through;
    color: var(--completed-color);
}

li.completed {
    border-left: 3px solid var(--success-color);
    opacity: 0.6;
}

/* ─── Input de edição inline ────────────────────────────────────────────── */
.edit-input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(0,240,255,0.8);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    padding: 2px 4px;
    margin-right: 10px;
    font-family: inherit;
    caret-color: #00f0ff;
}

/* ─── Botão excluir ─────────────────────────────────────────────────────── */
.delete-btn {
    background-color: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.delete-btn:hover {
    background-color: var(--danger-color);
    color: white;
    box-shadow: none;
    transform: none;
}

/* Estado de confirmação de exclusão */
.delete-btn.confirming {
    background-color: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
    animation: pulse-danger 0.6s ease infinite alternate;
}

@keyframes pulse-danger {
    from { box-shadow: 0 0 4px var(--danger-color); }
    to   { box-shadow: 0 0 12px var(--danger-color); }
}

/* ─── Alerta ────────────────────────────────────────────────────────────── */
.alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffeb3b;
    color: #333;
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: opacity 0.3s;
}

.hidden {
    display: none;
    opacity: 0;
}

/* ─── Responsividade Mobile ─────────────────────────────────────────────── */

/* Tablet / telas médias */
@media (max-width: 600px) {
    body {
        align-items: flex-start;
        padding: 0;
    }

    .container {
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        border-radius: 0;
        padding: 1.5rem 1rem;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    h1 {
        font-size: 1.4rem;
    }

    .stats {
        font-size: 0.85rem;
        gap: 8px;
    }

    .input-group {
        flex-direction: column;
        gap: 8px;
    }

    input[type="text"] {
        width: 100%;
        font-size: 1rem;
        padding: 14px 12px;
        /* melhor para teclado mobile */
        background: rgba(255,255,255,0.07);
        border: 1px solid rgba(255,255,255,0.2);
        color: var(--text-color);
        border-radius: 10px;
    }

    input[type="text"]::placeholder {
        color: rgba(255,255,255,0.35);
    }

    button#add-btn {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .filters {
        gap: 6px;
        flex-wrap: wrap;
    }

    .filter-btn {
        flex: 1;
        text-align: center;
        padding: 8px 6px;
        font-size: 0.8rem;
    }

    li {
        padding: 14px 12px;
        gap: 8px;
        /* em mobile, hover não existe — remove efeito de elevação */
        touch-action: pan-y;
    }

    /* desativa hover de elevação no touch */
    li:hover {
        transform: none;
        box-shadow:
            0 0 15px rgba(0,240,255,0.25),
            inset 0 0 10px rgba(255,255,255,0.05);
    }

    .task-text {
        font-size: 0.95rem;
        word-break: break-word;
        margin-right: 8px;
        /* toque mais fácil */
        padding: 4px 0;
    }

    .delete-btn {
        padding: 8px 10px;
        font-size: 0.75rem;
        flex-shrink: 0;
    }

    .edit-input {
        font-size: 0.95rem;
    }

    .alert {
        width: 90%;
        text-align: center;
        font-size: 0.9rem;
        top: 12px;
    }
}

/* Telas muito pequenas (320px) */
@media (max-width: 360px) {
    h1 {
        font-size: 1.2rem;
    }

    .filter-btn {
        font-size: 0.75rem;
        padding: 7px 4px;
    }

    .delete-btn {
        font-size: 0.7rem;
        padding: 7px 8px;
    }
}
