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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
}

.container {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
}

header h1 {
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.75rem;
}

/* Formulario para agregar tareas */
.form-agregar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.input-tarea {
    flex: 1;
    padding: 0.875rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

.input-tarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn-agregar {
    padding: 0.875rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    width: 100%;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.btn-agregar:hover {
    background: #5568d3;
}

.btn-agregar:active {
    transform: scale(0.98);
}

.btn-agregar:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Lista de tareas */
.lista-tareas {
    margin-top: 1rem;
}

.sin-tareas {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 2rem;
}

.tareas {
    list-style: none;
}

.tarea {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #667eea;
    transition: all 0.3s;
}

.tarea:hover {
    background: #e9ecef;
}

.tarea-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
}

.tarea.completada {
    opacity: 0.7;
    border-left-color: #28a745;
}

.tarea.completada .texto-tarea {
    text-decoration: line-through;
    color: #6c757d;
}

.texto-tarea {
    flex: 1;
    color: #333;
    font-size: 1rem;
    word-break: break-word;
    min-width: 0;
}

.btn-completar {
    padding: 0.625rem 1rem;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.3s, transform 0.1s;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: center;
    display: inline-block;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-completar:active {
    transform: scale(0.95);
}

.btn-completar:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.tarea.completada .btn-completar {
    background: #6c757d;
}

.btn-completar:hover {
    background: #218838;
}

.tarea.completada .btn-completar:hover {
    background: #5a6268;
}

/* Media Queries para tablets y escritorio */
@media (min-width: 480px) {
    body {
        padding: 1.5rem;
    }
    
    .container {
        padding: 2rem;
    }
    
    header h1 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .form-agregar {
        flex-direction: row;
        gap: 0.5rem;
        margin-bottom: 2rem;
    }
    
    .btn-agregar {
        width: auto;
        padding: 0.75rem 1.5rem;
    }
    
    .tarea {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0;
        padding: 1rem;
    }
    
    .tarea:hover {
        transform: translateX(5px);
    }
    
    .tarea-content {
        flex-direction: row;
        gap: 0;
    }
    
    .btn-completar {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (min-width: 768px) {
    body {
        padding: 2rem 1rem;
    }
    
    .container {
        padding: 2rem;
    }
}

