/* Reset e Variáveis de Cores */
:root {
    --bg-color: #F4F5F8;
    --text-color: #1A1A1A;
    --primary-color: #C9387D;
    --alert-color: #D9435E;
    --border-color: #E6E6E6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.container {
    width: 100%;
    max-width: 600px;
}

/* Cabeçalho e Logo */
header {
    margin-bottom: 2rem;
}
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo-icon {
    color: var(--primary-color);
}

/* Tipografia e Link de Voltar */
.btn-back {
    text-decoration: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

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

/* Formulário */
#item-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

#item-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

#item-input:focus {
    border-color: var(--primary-color);
}

#add-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s;
}

#add-button:hover {
    opacity: 0.9;
}

/* Lista de Compras */
#shopping-list {
    list-style: none;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.item-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.item-container:last-child {
    border-bottom: none;
}

.item-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Checkbox customizado (simples) */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.completed span {
    text-decoration: line-through;
    opacity: 0.5;
}

.remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.remove-btn:hover {
    opacity: 1;
    color: var(--alert-color);
}

/* Alerta */
.alert {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--alert-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(217, 67, 94, 0.3);
    transition: opacity 0.3s ease, bottom 0.3s ease;
}

.alert.hidden {
    opacity: 0;
    bottom: -50px;
    pointer-events: none;
}

#close-alert {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Responsividade Mobile */
@media (max-width: 480px) {
    #item-form {
        flex-direction: column;
    }
    #add-button {
        width: 100%;
    }
}