/* Importando as fontes do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400..700&display=swap');

/* Estilos gerais para o corpo da página */
body {
    font-family: 'Poppins', sans-serif;
    color: #e2e8f0;
    margin: 0;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    /* Gradiente para o Modo Escuro */
    background: radial-gradient(circle, #1a2e45 0%, #0b1a2a 100%);
    transition: background 0.5s ease;
}

/* Estilizando o cabeçalho */
header {
    margin-bottom: 40px;
}

/* Contêiner para centralizar o título */
.header-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

/* O H1 tem a animação de digitação, sem o cursor */
.header-title__title {
    color: #ffffff;
    font-size: 5em;
    font-weight: 400; 
    font-family: 'Lora', serif;
    margin: 0;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    animation: typing 3s steps(11, end) forwards;
}

/* Pseudo-elemento que cria o cursor piscando */
.header-title__title::after {
    content: '';
    display: inline-block;
    vertical-align: top;
    height: 1em;
    width: .15em;
    background: white;
    animation: blink-caret .75s step-end infinite;
}

/* Estilo para a descrição da página */
.header-title__description {
    font-size: 15px;
    color: #94a3b8;
    margin: 0;
}

/* @keyframes para a animação de digitação */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

/* @keyframes para a animação do cursor */
@keyframes blink-caret {
    from, to { background-color: transparent }
    50% { background-color: white; }
}

/* Estilo principal do contêiner */
main {
    padding: 40px;
    border-radius: 8px;
    box-shadow: none;
    width: 100%;
    max-width: 600px;
    text-align: center;
    background-color: transparent;
}

/* Contêiner de input minimalista */
#taskInputContainer {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #1a2e45;
}

#taskInput {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 12px;
    font-size: 1em;
    outline: none;
}

#taskInput::placeholder {
    color: #94a3b8;
}

#addTaskButton {
    background-color: transparent;
    color: #38a169;
    border: none;
    padding: 12px 20px;
    border-radius: 0;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: color 0.3s ease, transform 0.2s ease;
}

#addTaskButton:hover {
    color: #2f855a;
    transform: translateY(-2px);
}

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

/* Estilo de pílula para as tarefas individuais */
.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #1a2e45;
    padding: 10px 15px;
    border-radius: 25px;
    margin-bottom: 10px;
    border: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.task-item:hover {
    background-color: #1f344e;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.task-item.completed {
    text-decoration: line-through;
    color: #64748b;
    background-color: #1f344e;
}

.task-item.completed label::before {
    background-color: #38a169;
    border-color: #38a169;
}

/* Esconde o checkbox padrão */
.task-item input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

/* Estilo do LABEL que envolve o checkbox e o texto */
.task-item label {
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-grow: 1;
    text-align: left;
}

/* Cria o ícone de check personalizado (círculo) */
.task-item label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #94a3b8;
    border-radius: 50%;
    transition: background-color 0.2s, border-color 0.2s;
}

/* Cor do círculo quando marcado */
.task-item input[type="checkbox"]:checked + label::before {
    background-color: #38a169;
    border-color: #38a169;
}

/* O ícone de '✓' para quando marcado */
.task-item input[type="checkbox"]:checked + label::after {
    content: '✓';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #fff;
    font-weight: bold;
}

/* Estilo para o texto da tarefa dentro do label */
.task-item label span {
    flex-grow: 1;
    margin-left: 10px;
    color: #e2e8f0;
}

/* Estilo para o botão de lixeira (SVG) */
.task-item button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilo do ícone SVG de lixeira */
.task-item button svg {
    stroke: #fca5a5;
    width: 20px;
    height: 20px;
    transition: stroke 0.3s ease;
}

.task-item button:hover svg {
    stroke: #ef4444;
}

.filters__container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.filters__button {
    background-color: transparent;
    color: #94a3b8;
    border: 2px solid #94a3b8;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.filters__button:hover {
    background-color: #94a3b8;
    color: #1a2e45;
    border-color: #94a3b8;
}

.filters__button.active {
    background-color: #38a169;
    color: #fff;
    border-color: #38a169;
}

/* ===================================
   Animação para Exclusão de Tarefas
   ===================================
*/
.slide-out {
    animation: slideOut 0.4s ease-in forwards;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
        height: auto;
        padding: 10px 15px;
    }
    to {
        transform: translateX(-100px);
        opacity: 0;
        height: 0;
        padding: 0;
        margin-bottom: 0;
    }
}
/* ===================================
   Estilo do Rodapé Fixo
   ===================================
*/
footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 15px 0;
    background-color: #0d1e2f; /* Uma cor escura para combinar com o tema */
    color: #e2e8f0;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

footer p {
    margin: 0;
    font-size: 0.9em;
}

/* Adicione um padding na parte inferior do body para que o conteúdo não fique escondido atrás do rodapé fixo */
body {
    padding-bottom: 60px; /* Ajuste este valor se o rodapé for mais alto */
}

@media (max-width: 650px) {
    /* Ajuste para o corpo e contêiner principal */
    body {
        padding: 0 10px; /* Reduz o padding lateral */
    }

    main {
        padding: 20px; /* Reduz o padding interno do contêiner principal */
        max-width: 95%; /* Garante que ocupe quase toda a largura */
    }

    /* Reduz o tamanho do título principal e o espaçamento */
    .header-title__title {
        font-size: 3.5em; /* Diminui o título */
    }
    
    /* Reduz o tamanho do cursor para acompanhar o título */
    main .header-title__title::after {
        width: .1em;
    }
    
    /* Reduz a margem do cabeçalho */
    header {
        margin-bottom: 20px;
    }

    /* Ajuste para a pílula de tarefa */
    .task-item {
        padding: 8px 10px;
        border-radius: 20px;
    }
    
    /* Ajuste para o checkbox */
    .task-item label {
        padding-left: 25px;
    }

    .task-item label::before {
        width: 16px;
        height: 16px;
    }

    .task-item input[type="checkbox"]:checked + label::after {
        font-size: 12px;
        left: 4px;
    }
    
    /* Ajuste para o ícone de lixeira (SVG) */
    .task-item button svg {
        width: 18px;
        height: 18px;
    }
}