/* ===== VARIÁVEIS CSS ===== */
:root {
    --bg-primary: #0f0f1e;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #262641;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --accent-blue: #0066ff;
    --accent-blue-hover: #0052cc;
    --accent-red: #ff3333;
    --accent-red-hover: #e60000;
    --border-color: #333344;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

/* ===== CONTAINER PRINCIPAL ===== */
#main {
    max-width: 600px;
    margin: 0 auto 40px;
    background: var(--bg-secondary);
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    animation: slideDown 0.5s ease-out;
}

/* ===== TÍTULO ===== */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    background: linear-gradient(135deg, #00d4ff 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.1);
    letter-spacing: 1px;
    animation: fadeIn 0.8s ease-out;
}

/* ===== INPUT E CONTAINER DE ENTRADA ===== */
div#main > input,
div#main > button {
    display: inline-block;
    vertical-align: middle;
}

#inputTarefa {
    width: calc(100% - 90px);
    padding: 14px 18px;
    font-size: 16px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

#inputTarefa::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

#inputTarefa:focus {
    border-color: var(--accent-blue);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
    padding-left: 20px;
}

/* ===== BOTÃO ADD ===== */
button {
    width: 80px;
    padding: 14px 0;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #0052cc 100%);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
}

button:hover::before {
    left: 100%;
}

button:hover {
    background: linear-gradient(135deg, var(--accent-blue-hover) 0%, #003d99 100%);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.3);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 102, 255, 0.2);
}

/* ===== CONTAINER DA LISTA ===== */
#lista {
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out 0.2s backwards;
}

#lista ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ===== ITENS DA LISTA ===== */
#lista ul li {
    background: var(--bg-secondary);
    padding: 18px 22px;
    margin-bottom: 12px;
    border-radius: 10px;
    border-left: 4px solid var(--accent-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    animation: slideInLeft 0.4s ease-out;
}

#lista ul li:hover {
    background: var(--bg-tertiary);
    border-left-color: #00d4ff;
    box-shadow: 0 8px 25px rgba(0, 102, 255, 0.15);
    transform: translateX(8px);
}

/* ===== TEXTO DA TAREFA ===== */
#lista ul li::first-line {
    font-weight: 500;
}

/* ===== LINK DE EXCLUIR ===== */
#lista ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    margin-left: auto;
    padding: 6px 12px;
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
    opacity: 0.7;
}

#lista ul li a:hover {
    color: white;
    background: rgba(255, 51, 51, 0.15);
    color: var(--accent-red);
    opacity: 1;
    text-decoration: underline;
    padding: 6px 14px;
}

#lista ul li a:active {
    transform: scale(0.95);
}

/* ===== ANIMAÇÕES ===== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 600px) {
    #main {
        padding: 25px 20px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 20px;
    }

    #inputTarefa,
    button {
        padding: 12px 16px;
        font-size: 14px;
    }

    #inputTarefa {
        width: calc(100% - 60px);
    }

    button {
        width: 60px;
        font-size: 12px;
    }

    #lista ul li {
        padding: 15px 16px;
        margin-bottom: 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    #lista ul li a {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 400px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.7rem;
    }

    #main {
        padding: 20px 15px;
    }

    #inputTarefa {
        width: calc(100% - 55px);
        padding: 10px 12px;
    }

    button {
        width: 55px;
        padding: 10px;
    }
}
